There's really no way to see how many users are on line. You can "guess" and say that if they were active in the past X minutes, then they are "online". How you'd do that is save a timestamp along with your session_ID in the database and update it whenever the person does something.
You could try and get a count of the session files, too, but that's not completely accurate either, since old sessions are cleaned up every so many seconds/minutes/whatever... ---John Holmes... > -----Original Message----- > From: Tyler Longren [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 23, 2002 5:21 PM > To: php-general > Subject: [PHP] checking session ID's > > Hi list, it's been a while. > > I want to see how many users are online. I store the users $PHPSESSID in > a > database field (phpsessid) when they login. When they logout, the > $PHPSESSID value in phpsessid is removed. I could just see how many rows > have something in the phpsessid field, but if a user doesn't click the > "Logout" button, then the value stays there, it doesn't get removed. > > So, does anyone know how else I could do this? If I could check to see if > an $PHPSESSID is valid, I could look through the database and check to see > if the value in the phpsessid field is still valid. > > Any ideas? > > thanks, > Tyler > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php