Hello Friends.
I am facing a problem
actually i have to show my user that who is online and offline right now for this i am using a database table. when user login than i make a entry of this record along with the user id and date time. and using these records i can show who is online.
when user logout through logout link than i delete the record along with this userid.
my problem is when user close the browser without logout link than user get logout but the entry which is in the database table is not deleted. as the user does not goes over the logout page and the delete query is not executed..
can anybody suggest me any solution that how i can execute my delete query when user goes logout via the browser closed.
thanks in advance
when a user close the browser without login
Moderator: General Moderators
Re: when a user close the browser without login
You can't. If the user closes the browser window without logging out there is no way to tell. You have to record the time the user last interacted with the site and assume that they've logged out after a certain time eg 5 minutes with no activity.
Is this a class assignment for college or something? We've had this question asked here a few times in the past week. If it is, why don't you talk to your classmates?
Is this a class assignment for college or something? We've had this question asked here a few times in the past week. If it is, why don't you talk to your classmates?
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: when a user close the browser without login
I don't see a problem with logging a user out after a certain period of time.