Laravel - Auth Session not expiring after browser close

帅比萌擦擦* 提交于 2019-12-18 08:21:13

问题


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

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.

in app/config/session.php, variables are determined as

'lifetime' => 120,

'expire_on_close' => true,

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

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


回答1:


It is a desired behavior to be logged in after you re-open the browser. You can change this in app/config/session.php by setting

'expire_on_close' => true,



回答2:


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.

For more info: https://code.google.com/p/chromium/issues/detail?id=128513



来源:https://stackoverflow.com/questions/25114267/laravel-auth-session-not-expiring-after-browser-close

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!