how to know in my admin panel user when logout

Discussion in 'PHP' started by dineshsingh1984, Jun 15, 2012.

  1. #1
    how to know in my admin panel if user close the browser directally without click at signout/logout button...........
    plz tell me.........
     
    dineshsingh1984, Jun 15, 2012 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    Since the site never gets told that the user closed the browser, you can't.

    The web uses a disconnected model. The browser connects, downloads the page (and interacts in other ways, say if there's some AJAX on the page), then disconnects. By the time the user is reading the page, he's no longer connected to it.

    You could write some Javascript to capture the onUnLoad() event and tell the site that the browser is unloading the page, but I wouldn't (for many reasons beyond the scope of this forum). And there's really no reason you'd want to know anyway.
     
    Rukbat, Jun 15, 2012 IP