-
August 28th, 2006, 06:32 PM
#1
User presence monitoring
Hello
I'm using PHP&MySQL
So when user login, time is recorded in DB.
When he push log out button, time is recorded in DB.
When he turns off his computer, or close browser, logout field holds NULL value (Log out NOT pushed).
How to fight that issue?
PeeJavery told me that it can be solved through Ajax only.
-
September 7th, 2006, 04:51 PM
#2
Re: User presence monitoring
What?
No reply?
AJAX seems to be quite unpopular... LOL!
Ipsens
-
September 11th, 2006, 01:15 PM
#3
Re: User presence monitoring
I'm not sure if you can do this with PHP, but here's what you 'could' do if it were java - perhaps PHP has something similar to this:
when a user logs in, add their information to a list stored globally (in java this could be in a singleton. with .net you can simply store this in the Server object). every time someone hits the server with a link or button click, it resets a time stamp. run a thread that checks for 'dead users' every couple of minute - if the time stamp is stale (has exceeded the max time allotted for a live session -eg: past 20 minutes) stamp them as 'logged out' in the database. if they were logged in and created a session, that session would have expired at 20 minutes (default setting) anyways and they'd have had to relogin.
-
September 23rd, 2006, 10:55 AM
#4
Re: User presence monitoring
My product, also written in php is similar. What you need to do is, rather than just stamp a time for login/logout, is create a session object on server side. I have a simple process, written in c, that monitors those sessions and does numerous things. One of its functions is to end the session when the timeout value has been reached.
Good luck!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|