Sep 12, 2018
18
Level 6
Hot to forget user session when browser is closed? Laravel 5.6.
Hello everyone this problem has been posted 3 years ago and i don't see the answer here: https://laracasts.com/discuss/channels/general-discussion/how-to-close-session-when-browser-chrome-closed
Is there a way to logout user or forget user's session when browser is closed in Laravel 5.6?
Level 67
Look at the /config/session.php file. It has this as default
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
change expire_on_close to true
4 likes
Please or to participate in this conversation.