1

Chrome is not adhering to my Laravel Session setting 'expire_on_close' => false. When I close down Chrome, reopen the browser and navigate back to my url I am still logged in.

I'm aware that this post describes that Chrome will not fix/address this. BUT has anoyone come up with a solution or workaround that will force cookies to expire when the Chrome browser closes? Maybe a php.ini setting?

The only solution I can think of having my Laravel web app send ajax 'keep alive' pings every 5 minutes back to the server and record those in a mysql table against a cookie's uid. So when someone closes down Chrome and reopens it (after > 5mins) I will know their session has expired. But even this will fail for the usecase 'someone is working on a public computer, closes Chrome, another person opens chrome within < 5 mins and navigates to our website and is logged in as that first user'.

sazr
  • 24,984
  • 66
  • 194
  • 362
  • 2
    When you actually close chrome it keeps running in background. so your expire_on_close is not triggered since Chrome still open though it is in background. So its not laravel error. I'd suggest you to check chrome discussions boards for any kind of workaround also check this https://stackoverflow.com/questions/10617954/chrome-doesnt-delete-session-cookies – Anar Bayramov Sep 15 '17 at 01:49
  • 1
    @AnarBayramov yes I've read that post. If you read that link, all their suggested solutions are performed client side (ie, change your chrome settings). *Maybe deleting the cookie on page unload is a possible solution?* Multiple tabs open on the same web app will experience problems though but I guess I could use HTML5 local storage to increment/decrement open tabs. 'At-all' anyone tried this and had cross-browser & cross-version success? – sazr Sep 15 '17 at 02:42
  • @sazr i've the same problem. After some time, do you find a solution? – Francesco Taioli Apr 05 '20 at 16:26

0 Answers0