Catching a window close event

Results 1 to 4 of 4

Thread: Catching a window close event

  1. #1
    Dave Alvarado Guest

    Default Catching a window close event

    I have two pages in an application. The first one does nothing but open the second full-screen with no menu bar, location, toolbar, etc. This second window is my main application window where users log into a system and perform various tasks. The problem I am having is catching when a user clicks the "x" in the top right corner of the browser and closes the browser window. In this situation, I want to log the user out by either redirecting the window to a logout script page (logout.asp) or opening a new window with the logout script page. I&#039ve tried all the events of the second application window I could think of, but nothing worked except window.onbeforeunload, which has the problem of firing every time the user refreshes the page. Any help here would be greatly appreciated.

  2. #2
    Ian Payne Guest

    Default RE: Catching a window close event

    Have you tried using the Session_OnEnd event in global.asa?

  3. #3
    Dave Alvarado Guest

    Default RE: Catching a window close event

    The application is going to be distributed over several web servers, so anything session is out of the question. Plus, the original window is still holding the user&#039s session, so the session won&#039t end when the second window is closed.

  4. #4
    Join Date
    Dec 1969

    Default RE: Catching a window close event

    Maybe you should try:<BR>onunload in your second page to call<BR>javascript function:<BR>window.opener.location.href="logout.a sp" to<BR>open logout.asp in your first window.

Posting Permissions

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