Catch Lost Session

Discussion in 'ASP General' started by Kit Truong, Feb 18, 2004.

  1. Kit Truong

    Kit Truong Guest

    Is there any way in ASP to catch a destroyed session when the user closes
    their window.

    Example.

    - When a user enters a page, I create a session - Session("blah")="blah"
    - However when the window is closed, the session is destroyed, but before
    it's being destroyed, I want to some things....

    Any thoughts?
     
    Kit Truong, Feb 18, 2004
    #1
    1. Advertising

  2. Kit Truong

    Ray at Guest

    "Kit Truong" <> wrote in message
    news:pnPYb.8881$...
    > Is there any way in ASP to catch a destroyed session when the user closes
    > their window.
    >
    > Example.
    >
    > - When a user enters a page, I create a session - Session("blah")="blah"
    > - However when the window is closed, the session is destroyed,


    This is not true.

    > but before
    > it's being destroyed, I want to some things....


    Sub Session_OnEnd()
    '''your code
    End Sub

    in global.asa in the application root.

    Ray at work
     
    Ray at, Feb 18, 2004
    #2
    1. Advertising

  3. "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
    message news:...
    >
    > "Kit Truong" <> wrote in message
    > news:pnPYb.8881$...
    > > Is there any way in ASP to catch a destroyed session when the user

    closes
    > > their window.
    > >
    > > Example.
    > >
    > > - When a user enters a page, I create a session - Session("blah")="blah"
    > > - However when the window is closed, the session is destroyed,

    >
    > This is not true.
    >
    > > but before
    > > it's being destroyed, I want to some things....

    >
    > Sub Session_OnEnd()
    > '''your code
    > End Sub
    >
    > in global.asa in the application root.
    >
    > Ray at work
    >


    session_onend is not a good place to put any code. It doesn't fire reliably.
    Better find somewhere else to run code which does any clean up you might
    need.

    There is no way for the web server to know that you have closed a browser
    down.

    --
    John Blessing

    http://www.LbeHelpdesk.com - Help Desk software priced to suit all
    businesses
    http://www.free-helpdesk.com - Completely free help desk software !
    http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
     
    John Blessing, Feb 18, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carpe Diem
    Replies:
    3
    Views:
    7,188
    Carpe Diem
    Feb 23, 2004
  2. =?ISO-8859-15?Q?Josef_Bl=F6sl?=
    Replies:
    1
    Views:
    25,876
  3. John Black
    Replies:
    8
    Views:
    4,161
    Xenos
    Aug 20, 2004
  4. Adam
    Replies:
    9
    Views:
    577
    red floyd
    Feb 2, 2006
  5. Marteno Rodia

    catch doesn't catch a thrown exception

    Marteno Rodia, Aug 3, 2009, in forum: Java
    Replies:
    5
    Views:
    569
    Daniel Pitts
    Aug 5, 2009
Loading...

Share This Page