0

I am using laravel 8. when i login and try to close browser or tab then before close I want ask confirmation massage with ok and cancel button. If user clicks ok then logout user if cancel stay on same page. I have tried javacript beforeunload method but didnot work.as if fire on all button and link click.

in laravel i tried session.php ‘expire_on_close’ set true but not working.

  • 4
    Does this answer your question? [JavaScript before leaving the page](https://stackoverflow.com/questions/7080269/javascript-before-leaving-the-page) – DarkBee Dec 06 '21 at 10:10
  • You should not add a confirmation message when a user closes the tab or browser in my opinion. I also doubt it will be possible in most browsers. – Gert B. Dec 06 '21 at 12:56

0 Answers0