therealwesfoster Posted April 12, 2008 Share Posted April 12, 2008 I'm wanting to delete a user from the "whos online" part of a site once they leave the site. I was thinking about triggering an AJAX call with javascript once the page is closed. But would that leave enough time for the ajax to run? Would the page wait to close until the ajax returns a succes? What would be the best way to do this? Thanks Link to comment https://forums.phpfreaks.com/topic/100798-triggering-php-on-page-close/ Share on other sites More sharing options...
cytech Posted April 12, 2008 Share Posted April 12, 2008 Hey, Depends on if you have an extensive tracking system in place. One of my company sites tracks the user "everywhere" they go, so on the "list online users" page we simply check to see who has not updated the tracker say within 20 minutes and then we log them out. This is also a good method becuase you could if need be log a user out directly from the db since the session is corresponding with the db. Link to comment https://forums.phpfreaks.com/topic/100798-triggering-php-on-page-close/#findComment-515499 Share on other sites More sharing options...
therealwesfoster Posted April 12, 2008 Author Share Posted April 12, 2008 Thanks for the reply cytech, but thats how i currently have it setup. Anyone other ideas? Link to comment https://forums.phpfreaks.com/topic/100798-triggering-php-on-page-close/#findComment-515501 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.