capture user navigation from my page

elic05

Member
Joined
Nov 2, 2008
Messages
19
Programming Experience
Beginner
my chat works like that:

every client send a request to the server every 2 seconds and get back updated user list and the new messages he didnt get yet.

when the user logout (by clicking a logout button) a request is sent to the server, and the server delete him from the list of users (the list is kept in a Database)

when the user close the html window , i capture is by the unload method of the window and I log him out by ajax

the problem is:

when the user navigate to another page without clicking logout he stays on the list forever

i have 2 options to delete him

1 capture the navigation and invoke the ajax that will delete him from the list

2 create some app on the server that will delete users who don't send requests

if 1 or 2 or both are possible i will be glad to have a clue how

thanks
 
Back
Top