Necuima 18 Posted February 21, 2020 Report 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. Quote Link to post Share on other sites
Larry 428 Posted February 26, 2020 Report 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. Quote Link to post Share on other sites
Necuima 18 Posted February 26, 2020 Author Report Share Posted February 26, 2020 OK, I'll use the timestamp approach. Thanks for the advice. Cheers, Necuima Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.