If you are using the “FOSUserBundle” in Symfony, here is how you can check if a user is logged in:
if ( $this->get(‘security.context’)->isGranted(‘ROLE_USER’)) { //User is logged in } if( $this->container->get(‘security.context’)->isGranted(‘IS_AUTHENTICATED_FULLY’) ){ // authenticated (NON anonymous) }
For more information about user authentication in Symfony, visit the Friends of Symfony website at: https://github.com/FriendsOfSymfony/FOSUserBundle.
If you are an organization in the Jacksonville Northeast Florida area looking for open source PHP web developers with experience in Symfony, Drupal, WordPress, Magento, or API integration experts, please contact me. I have a list of competent web developers who I can recommend here in Jacksonville, Southwest Florida, and throughout the US, Canada, UK, Australia, and Germany as temporary web development consultants or remote web developers!