Site Sessions: Online/Offline - help?

From: Date: Mon, 16 Apr 2001 23:26:47 +0000
Subject: Site Sessions: Online/Offline - help?
Groups: php.general 
Request: Send a blank email to php-general+get-48832@lists.php.net to get a copy of this message
Greetings. Some of you are familiar with my latest project, a smaller community. I have implemented almost everything I need, and I wish to thank those of you who helped me with "which mail is new" and so forth. However, this problem is quite worse I suppose, but I hope some of you has done something like this before: Sessions. I wish to keep track of every visitor. Not a counter or anything, but more of when a person signs in, the users nickname will be bound to this session ID which will keep track of the person is online or offline. I have solved it like so: Whenever a person loggs in, I add it's name to a online.dat file. When the user signs of, I remove the nickname thus the login time from the file. PROBLEMS?? First one: User must click on "logout" to remove itself. Second: It does not always remove itself. Therefore, I ask: How can I create a new session for every visitor (so I know how many are online at the time), bind this ID to its nickname (so one row in a file would be: NICKNAME|SESSION_ID|DATE), and how can I make sure that whenever the browser is closed or whatever, or after a certain time of inactivity (3 minutes), the user is removed from the file. All help is greatly appriciated and your name will be on the credits list too. - Richard

« previous php.general (#48832) next »