JSHINER Posted March 27, 2008 Share Posted March 27, 2008 Wondering how I would go about seeing when users are online (like on this forum) - any suggestions? Link to comment https://forums.phpfreaks.com/topic/98192-seeing-when-users-are-online/ Share on other sites More sharing options...
BlueSkyIS Posted March 27, 2008 Share Posted March 27, 2008 whenever a user does anything on your site, update their user record with the current time. to determine whether they are online, check the last time they did anything. Link to comment https://forums.phpfreaks.com/topic/98192-seeing-when-users-are-online/#findComment-502396 Share on other sites More sharing options...
discomatt Posted March 27, 2008 Share Posted March 27, 2008 Easiest way to do this is making or using a custom session class utilizing a database. You can then just pull all active sessions from the DB for users online. Link to comment https://forums.phpfreaks.com/topic/98192-seeing-when-users-are-online/#findComment-502429 Share on other sites More sharing options...
JSHINER Posted March 27, 2008 Author Share Posted March 27, 2008 How do I pull active sessions from the DB? I currently have the login that creates a new session. Will those work? Link to comment https://forums.phpfreaks.com/topic/98192-seeing-when-users-are-online/#findComment-502439 Share on other sites More sharing options...
discomatt Posted March 27, 2008 Share Posted March 27, 2008 No, because one client's session information is not accessible through another's without some clever hacking. And even then, unless your session's temp directory is isolated, you can get incorrect results. It's possible, but requires a lot of hacking. The idea is to not use session_start() and the $_SESSION array to store a user's session, but rather use something like this: http://www.phpclasses.org/browse/package/1518.html Link to comment https://forums.phpfreaks.com/topic/98192-seeing-when-users-are-online/#findComment-502456 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.