0
我试图在Symfony 3.0.9中使用FOSUserBundle。FOSUserBundle只能登录一次
在完成教程here之后,我能够在昨天注册一个用户并使用它登录。问题是今天早上我无法用相同的凭证登录。经过一些测试后,我发现当我关闭窗户时,无法与用户一起登录。
所以我必须从数据库中删除用户并创建一个新的。 任何人都可以帮我解决这个问题吗? 当然,用户应该能够登录,注销并关闭brwoser而无需注销。
我SecurityController.php:
class SecurityController extends Controller
{
/**
* @Route("/login", name="login")
*/
public function loginAction(Request $request)
{
$authenticationUtils = $this->get('security.authentication_utils');
// get the login error if there is one
$error = $authenticationUtils->getLastAuthenticationError();
// last username entered by the user
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render(
'security/login.html.twig',
array(
// last username entered by the user
'last_username' => $lastUsername,
'error' => $error,
)
);
}
}