View Full Version : How to determine when a client has left a domain?

02-26-2012, 04:32 AM
I have been developing in html/css/javascript/Flash ActionScript on the
client side and php/MySQL on the server side for a while now and have
encountered the issue with when to know when client tracking can be
closed; I.E.
1: the client has navigated to another domain, and has no other
windows opened with the current domain
2: the client has used his/her 'Home' button (onunload event can't
tell what is being done by the client)
3: The client software is exited.
4: network connection goes bad or down.

It appears that a broad solution would be to modify protocols to require
http and ftp clients to sent a notice to the server when there are no more
windows or connections to a domain.

It seems that that issue would have been addressed, considering all the session handling that goes on. So far an explicit logout mechanism has
to be used by the client, which is elective. Otherwise there is a pile of
session records with loose ends.

Ultimately, is there accommodation already in these protocols for this; I
don't know of any.

Thanks for time and attention and comments, suggestions, etc

02-26-2012, 04:35 AM
For those visitors who have JavaScript enabled you could use an ajax call to the server on a setInterval that lets the server know they are still on the page. When the interval passes and a new signal isn't received then you know they left during the prior interval.

There is no way to tell if they don't allow that script to run.

There will never be anything in any of the protocols to handle this as modifications are being made to introduce privacy and not to remove what little privacy the internet does already have built in.