>> For every click done by logged in users update this column with the current timestamp
How to record clicks with php ? if users are participating in a chat on site or just went away for a cup of tea
but will come back within minutes then if the user is still online and logged in, I'd like to count him as
'online'
short, I've seen sites they have written under their list of online users 'updated' every five minutes. Would be ok with me.
However, how is this done? how to check if user still online?
Main Topics
Browse All Topics





by: cxrPosted on 2009-03-08 at 07:21:02ID: 23829471
This won't happen automatically, you would have to write code to set those columns to NULL. I would put a new column in the user profile table: last_seen. For every click done by logged in users, update this column with the current timestamp. When the timestamp is more than X minutes old, you can consider the user as "logged out", and set the session_id to NULL, or you can let the session_id live forever, but use the timestamp when you make your list of online users.