Detecting user logoff

Results 1 to 2 of 2

Thread: Detecting user logoff

  1. #1
    Join Date
    Dec 1969

    Default Detecting user logoff

    At my work I have a website where only one user may log in at a time. I&#039;m trying to figure out how to run certain asp code when a user exits the asp page. I tried using the session_onstart and session_onend in global.asa but only session_onstart works. When the user exits the asp page, session_onend does not seem to execute. Any ideas?<BR><BR>Thanks,<BR>Peter Grabky

  2. #2
    Join Date
    Dec 1969

    Default RE: Detecting user logoff

    Session_OnEnd does NOT EXECUTE WHEN THE USER CLOSES THE BROWSER.<BR><BR>(In fact, in my experience, whether it executes reliably or not is up for discussion.)<BR><BR>Session_OnEnd (surprisingly) executes when the SESSION ends, which is either:<BR>1) When Session.Abandon is called from within an ASP script<BR>2) 20 minutes (default) after the last HTTP request by the client.<BR><BR>You could do something using the onUnload body event handler which triggers a new window which calls Session.Abandon and then immediately closes the window. However, only IE5+ will understand that event handler, and many people may object to the new window opening in the first place.<BR><BR>Craig.

Posting Permissions

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