ttommy Posted October 25, 2006 Share Posted October 25, 2006 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 helpTommy Quote Link to comment Share on other sites More sharing options...
gmwebs Posted October 25, 2006 Share Posted October 25, 2006 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.