Re: [PHP] Showing all users who are logged in
Vail, Warren wrote: I did one application where I used the PHP session table to tell who was logged on, and which area of the application they were most recently in. One of several flaws, was that I used Kill session to logoff, and that caused them to disappear from any count of users logged on. Course, if they had logged off, then they weren't logged on, but on the other side, users were counted for every session they created, and closing and opening new browser sessions caused them to be counted multiple times, and continue to be counted until session garbage cleanup removed their session entries, unless I used the session timestamp in my count algorithm. Session was nice, because if a user was causing a problem, I could kill his session entry, effectively logging him off, forcing him to logon again. Warren Vail Thanks guys. Between your suggestions, I managed to come up with a solution. -- Jason Giangrande [EMAIL PROTECTED] http://www.giangrande.org http://www.dogsiview.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Showing all users who are logged in
On Tue, 27 Jul 2004 19:55:49 -0400, Jason Giangrande [EMAIL PROTECTED] wrote: Anyone have any suggestions as to the best way to keep track of all users who are logged in at a given time? I thought of writing them to a temp text file and them deleting the names from the file when a user logged out, but I think there has to be a better way. Anyone have any suggestions? Save when a user logs in to the DB. Or whenever they access a page. Clear them out after x minutes and no activity. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Showing all users who are logged in
If you have a users table, you could add a field to it that contains the last login datetime. and query that table for datetimes that are less then your session timeout (if one exists). Of coarse, you would have to update that table when a user logs in. Jason On Tue, 27 Jul 2004 19:55:49 -0400, Jason Giangrande [EMAIL PROTECTED] wrote: Anyone have any suggestions as to the best way to keep track of all users who are logged in at a given time? I thought of writing them to a temp text file and them deleting the names from the file when a user logged out, but I think there has to be a better way. Anyone have any suggestions? -- Jason Giangrande [EMAIL PROTECTED] http://www.giangrande.org http://www.dogsiview.com -- 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
RE: [PHP] Showing all users who are logged in
I did one application where I used the PHP session table to tell who was logged on, and which area of the application they were most recently in. One of several flaws, was that I used Kill session to logoff, and that caused them to disappear from any count of users logged on. Course, if they had logged off, then they weren't logged on, but on the other side, users were counted for every session they created, and closing and opening new browser sessions caused them to be counted multiple times, and continue to be counted until session garbage cleanup removed their session entries, unless I used the session timestamp in my count algorithm. Session was nice, because if a user was causing a problem, I could kill his session entry, effectively logging him off, forcing him to logon again. Warren Vail -Original Message- From: Justin Patrin [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 27, 2004 5:05 PM To: Jason Giangrande Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Showing all users who are logged in On Tue, 27 Jul 2004 19:55:49 -0400, Jason Giangrande [EMAIL PROTECTED] wrote: Anyone have any suggestions as to the best way to keep track of all users who are logged in at a given time? I thought of writing them to a temp text file and them deleting the names from the file when a user logged out, but I think there has to be a better way. Anyone have any suggestions? Save when a user logs in to the DB. Or whenever they access a page. Clear them out after x minutes and no activity. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- 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