php - FOS UserBundle User Manager - login after updateUser -


i ask whether package fos userbundle when add user, can log user manager? if so, in way?

$usermanager = $this->container->get('fos_user.user_manager'); $user = $usermanager->createuser(); $user -> setusername('test'); $user -> setemail('test'); $user -> setplainpassword('test'); $user ->setenabled(true); $usermanager->updateuser($user, true);` 

`

problem solved.

$loginmanager = $this->container->get('fos_user.security.login_manager'); $firewallname =  $this->container->getparameter('fos_user.firewall_name'); $loginmanager->loginuser($firewallname, $user); 

thanks help


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo