7

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 !

menjaraz
  • 7,551
  • 4
  • 41
  • 81
medowlock
  • 1,469
  • 1
  • 19
  • 25
  • Are you sure there are no more Chrome instances in memory? – Antonio Carlos Ribeiro Mar 28 '14 at 13:09
  • 3
    Thanks for the response Antonio. This happens even after computer restart. Although after your comment, I did some more digging and it seems that the "Continue where I left off" option in Chrome settings has something to do with this. If this option is disabled, everything works fine. If however it is checked, even if the tab in question is closed (so it is not restored on re-opening chrome), when accessing the url, the session is still remembered. – medowlock Mar 28 '14 at 13:21
  • It looks more like a Chrome bug, Laravel is doing its job just fine since the cookie's expire is set to session. –  May 17 '14 at 12:20
  • @BogdanG after closing chrome look at the tray right click on chrome icon and close... it will work – Neto Braghetto May 21 '14 at 18:05
  • Not a bug. A "security feature" of Chrome. – Tom Sep 17 '14 at 22:15

1 Answers1

3

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

metude
  • 86
  • 4