I have a nice LogOut button on the menu of my PHP app, but some people don't use it, they just quit the browser.
Is there any way that I can detect quiting the browser and/or closing the last tab with my App open? (I realize that it won't handle browser crash, but it's better than I have now & covers 99% of cases).
I undestand that I can't use JavaScript since the DOM won't let my JS be aware of other brower tabs and windows.
I used a timer based solution, but a single user set the timeout to 999999 minutes and the number of simultaneous users to 1, then closed his browser & locked himself out.
But, what about another way? Think laterally, folks. Can I push a cookie when the user opens a new tab with a page from my app? And then remove the cookie when the user wishes to close the tab? And check if I am remvoing the last cookie & inform the server to treat this as logout?
If not cookies is there some other method? (Use Ajax on page open & close and the server can decide if the last tab has closed?)