Necuima Posted February 21, 2020 Share Posted February 21, 2020 (edited) Hi Larry, On pages 284-5 you mention the browser unload event. I'd appreciate your advice re what I imagine is a common issue in that if someone just closes the browser without logging out I want to be able to update a database table to set a logged-out condition. Can this be done reliably either with native JavaScript or jQuery initiating an AJAX call to a PHP module to effect the database update? My program is PHP with lots of jQuery. Looking forward to your advice re this or similar functionality and thank you in anticipation. Cheers, Necuima Edited February 21, 2020 by Necuima Additional information. Link to comment Share on other sites More sharing options...
Larry Posted February 26, 2020 Share Posted February 26, 2020 You can't rely upon a browser event for something like this. But if you use sessions or cookies, those will automatically expire. Or you can store a timestamp in the database to reflect the most recent activity and then add logic that checks that value. Link to comment Share on other sites More sharing options...
Necuima Posted February 26, 2020 Author Share Posted February 26, 2020 OK, I'll use the timestamp approach. Thanks for the advice. Cheers, Necuima Link to comment Share on other sites More sharing options...
Recommended Posts