how to automatically logout when close the browser in php?
Posted on 2014-11-27
This was already asked but the answer was incorrect. I had always assumed that when the browser is closed and the client computer is turned off that the session will not persist. This is not true. I know because I've experienced it. I turned off my computer and when I come back the session variable is still set. Not only was my browser closed and my PC turned off but Apache which was running on my computer was turned off also. What I've found is that if I close firefox without closing the tab that was open that the variable stays set. If I close the tab first and then close the variable it is unset. I can't find a solution or even an acknowledgement that this is an issue. I hear tales that you can have the session variables drop after some period of inactivity however I'm not sure how to get the timer to start once inactivity has set in.