Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Now Southern Oregon. I was born and had lived my life in Los Angeles until relocating last year (2010)
    Thanked 1 Time in 1 Post

    How to determine when a client has left a domain?

    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

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 666 Times in 655 Posts
    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.
    Last edited by felgall; 02-26-2012 at 04:38 AM.
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts