Jump to content


Photo

User Online tracking


  • Please log in to reply
1 reply to this topic

#1 ttommy

ttommy
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 25 October 2006 - 02:27 PM

Hi,
I'm constructing a member system. I want to know if is there any way to track the user. In case the user login to the system, I can know if he/she connected. Once he/she log out or turn the browser off, the system can inform me. I tried to create a the login field in the database. This solves the login logout thing, and work quite ok. But not many users obey the flow (i.e. logout before turn off the browser). Therefore, many users just turn off his/her browser. With this I cannot track if they are really online.
Is there any better way to track the user?
Thnks for ur help
Tommy

#2 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 25 October 2006 - 04:42 PM

The only way I know of is to timestamp the session. When the user logs in, add a timestamp to the user's record in your table. 5 minutes later, update the timestamp if the session ID is the same. Run a cron job to log any users off with session ID's that are more than 5 minutes old.

If you close the browser or leave without logging out, that session ID will be reset in 5 minutes.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users