2

I want to destroy session when tab/window close in laravel . I also changed

'expire_on_close' => true, //config/session.php

but still not working. I also executed necessary commands. like config:cache, config:clear , composer dump-autoload . Not working . Thanks in advance

Mithun
  • 255
  • 1
  • 7
  • 17
  • Does this answer your question? [After session destroy or close browser tab or close browser execute logout using Laravel 5.2](https://stackoverflow.com/questions/39408639/after-session-destroy-or-close-browser-tab-or-close-browser-execute-logout-using) – Ankit Jindal Sep 24 '20 at 03:55
  • You want to destroy session when **tab/window close** in laravel. Its not possible with Laravel. Laravel is server side and your window is client side. – STA Sep 24 '20 at 04:33
  • @sta thanks but I heard there is a feature on laravel – Mithun Sep 24 '20 at 04:37
  • @Ankit Jindal thanks. I already gone through on it but could not make any solution – Mithun Sep 24 '20 at 04:37
  • `'expire_on_close' => true,` is a desired behavior to be logged in after you re-open the browser. As your server side code will never know when a person closes a browser, your only reliable option is setting a short experation time. But even then let's say you set it for one minute like your code example, a person reads something or takes a quick phone call they will be logged out. – STA Sep 24 '20 at 04:42
  • @sta I agree with you . But There is a requirement . Also have some findings from google that it will be 'expire_on_close' => true, – Mithun Sep 24 '20 at 05:00

0 Answers0