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

查看:22
本文介绍了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天全站免登陆