use Symfony\Component\Security\Core\Authentication\Token\ -to-authenticate-login-manually-an-user-in-a-controller-with-or-without-fosuserbundle-on-symfony-3 $session->set('_security_main', serialize($token)); /** Fire the login event .