Laravel - authentication session does not expire after closing the browser

I have a problem with sessions or cookies, I did not understand the reason.

I sign up to my site using Auth::attempt($userdata, false) , which means that Laravel should not remember my login, but it remembers whether I use true or false in the try function.

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

 'lifetime' => 120, 'expire_on_close' => true, 

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

Edit: Issue resolved. The cause of the problem is Chrome. For more information, see My answer.

+6
source share
2 answers

I solved my own question. It turned out that the problem is related to Chrome. It continues to run in the background, so cookie values ​​do not disappear. I tried my application with firefox and it works fine.

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

+5
source

When you reopen the browser, registered behavior is required. You can change this in app/config/session.php by setting

 'expire_on_close' => true, 
+9
source

Source: https://habr.com/ru/post/973307/


All Articles