Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel expire session on browser close not working in Chrome

I am using Laravel Framework version 4.1.21 and the "expire_on_close" option does not end the session in Chrome when the browser is closed. The options in my config/session.php file look like this:

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

Also in the developer toolbar, under Resources > Cookies, the Expires value is set to "Session" for the laravel_session cookie.

This works fine in Firefox though. Any ideas what am I missing ? Thanks !

like image 884
medowlock Avatar asked Mar 28 '14 12:03

medowlock


1 Answers

It's becasue of Chrome's feature. When you close Google Chrome, it actually runs on background (as mentioned on comments).

Here's detailed information: https://code.google.com/p/chromium/issues/detail?id=128513

like image 184
metude Avatar answered Nov 12 '22 17:11

metude