Laravel-验证会话在浏览器关闭后不会过期 [英] Laravel - Auth Session not expiring after browser close

查看:215
本文介绍了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

这篇关于Laravel-验证会话在浏览器关闭后不会过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆