Laravel-验证会话在浏览器关闭后不会过期

问题描述:

我在会话或cookie方面遇到问题,我不明白原因.

I am having a problem about sessions, or cookies, I didn't understand the reason.

我使用Auth::attempt($userdata, false)登录到我的网站,这意味着Laravel不应该记住我的登录信息,但是它会记住我在尝试函数中使用true还是false.

I log on to my site with Auth::attempt($userdata, false), which means Laravel should not remember my login, but it remembers whether I use true or false in attempt function.

app/config/session.php中,变量确定为

'lifetime' => 120,

'expire_on_close' => true,

此外,当我使用Auth::attempt($userdata, true)登录时,'Auth::viaRemember()'函数将返回false.

Also, when I log in with Auth::attempt($userdata, true), 'Auth::viaRemember()' function returns false.

编辑:问题已解决.问题的原因是Chrome.请参阅我的答案以获取详细信息.

Question solved. Cause of the problem is Chrome. See my answer for detailed information.

我已经解决了自己的问题.看来问题出在Chrome的问题上.它继续在后台运行,因此cookie值不会消失.我在firefox上尝试了我的应用程序,并且运行良好.

I have solved my own question. It appeared that the problem is Chrome's problem. It continues to work in background, so the cookie values do not disappear. I tried my app with firefox and works perfectly.

有关更多信息: https://code.google.com/p/chromium/issues/detail?id = 128513