Jump to content

logout on closing browser


golem

Recommended Posts

possibly javascript.  php is server side, and has no idea what is happening on the user's end unless it is sent something.  i don't do javascript though, so someone else is going to have to chime in.

 

the only way to do it purely in php would be to save a timestamp when someone logs in, and if their session has been inactive for X number of minutes then flag them as logged out.  this script would likely be set up to run every X minutes with cron, and will likely hit your database more times than it is worth.  it won't have anything to do with the window closing though.  if you're interested in this method, a helpful tutorial can be found over at codewalkers.com:

 

http://codewalkers.com/tutorials/14/1.html

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.