Re: Session_End

Discussion in 'ASP .Net' started by Kevin Spencer, Aug 15, 2003.

  1. Also, the Page_Unload Event fires BEFORE the page is even returned to the
    browser. It is the event that is fired when the Page Class is unloaded after
    execution.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Neither a follower nor a lender be.

    "William F. Robertson, Jr." <> wrote in message
    news:...
    > Session_End is called in one of two ways.
    >
    > 1. Session.Abandon() is called from the codebehind file.
    > 2. The timeout has occured for the session.
    >
    > These are the only two reasons. (or if the application restarts)
    >
    > You will have to leave your debugger open for the timeout period (default

    of
    > 20 minutes). But don't close the browser window out. It will stop the
    > debugger if you are using Studio.
    >
    > HTH,
    >
    > bill
    >
    >
    >
    > "Tracey" <> wrote in message
    > news:05c901c36343$f97ccc10$...
    > > Hey folks, I've got an ASP.NET application running just
    > > fine and I want to handle the Session_End event, but the
    > > event just isn't firing. I can put a break point there or
    > > save a row to a log table and neither of these show the
    > > event firing. What is wrong here? Has someone actually
    > > trapped this event? Is there some trick to getting this
    > > thing to work? Is there a bug? What?
    > >
    > > I want to know when the client closes his/her explorer and
    > > the Session_End seemed like the perfect thing but the
    > > wretch event just won't fire. Then I tried intecepting the
    > > Page_Unload event of one of my web forms and I get an
    > > error! What is it about trying to find out when the
    > > session ends or someone closes their browser that is such
    > > a pain to intercept?

    >
    >
     
    Kevin Spencer, Aug 15, 2003
    #1
    1. Advertising

  2. Session_End is called in one of two ways.

    1. Session.Abandon() is called from the codebehind file.
    2. The timeout has occured for the session.

    These are the only two reasons. (or if the application restarts)

    You will have to leave your debugger open for the timeout period (default of
    20 minutes). But don't close the browser window out. It will stop the
    debugger if you are using Studio.

    HTH,

    bill



    "Tracey" <> wrote in message
    news:05c901c36343$f97ccc10$...
    > Hey folks, I've got an ASP.NET application running just
    > fine and I want to handle the Session_End event, but the
    > event just isn't firing. I can put a break point there or
    > save a row to a log table and neither of these show the
    > event firing. What is wrong here? Has someone actually
    > trapped this event? Is there some trick to getting this
    > thing to work? Is there a bug? What?
    >
    > I want to know when the client closes his/her explorer and
    > the Session_End seemed like the perfect thing but the
    > wretch event just won't fire. Then I tried intecepting the
    > Page_Unload event of one of my web forms and I get an
    > error! What is it about trying to find out when the
    > session ends or someone closes their browser that is such
    > a pain to intercept?
     
    William F. Robertson, Jr., Aug 15, 2003
    #2
    1. Advertising

  3. Kevin,

    I thought the page was sent to the browser in the Render event.

    Does the HtmlTextWriter hold the reponse data until after Page_Unload is
    called, and then flush it to the browser?

    If this is the default behavior, is it overridden when the Response.Flush is
    called?

    bill

    "Kevin Spencer" <> wrote in message
    news:...
    > Also, the Page_Unload Event fires BEFORE the page is even returned to the
    > browser. It is the event that is fired when the Page Class is unloaded

    after
    > execution.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > http://www.takempis.com
    > Neither a follower nor a lender be.
    >
    > "William F. Robertson, Jr." <> wrote in message
    > news:...
    > > Session_End is called in one of two ways.
    > >
    > > 1. Session.Abandon() is called from the codebehind file.
    > > 2. The timeout has occured for the session.
    > >
    > > These are the only two reasons. (or if the application restarts)
    > >
    > > You will have to leave your debugger open for the timeout period

    (default
    > of
    > > 20 minutes). But don't close the browser window out. It will stop the
    > > debugger if you are using Studio.
    > >
    > > HTH,
    > >
    > > bill
    > >
    > >
    > >
    > > "Tracey" <> wrote in message
    > > news:05c901c36343$f97ccc10$...
    > > > Hey folks, I've got an ASP.NET application running just
    > > > fine and I want to handle the Session_End event, but the
    > > > event just isn't firing. I can put a break point there or
    > > > save a row to a log table and neither of these show the
    > > > event firing. What is wrong here? Has someone actually
    > > > trapped this event? Is there some trick to getting this
    > > > thing to work? Is there a bug? What?
    > > >
    > > > I want to know when the client closes his/her explorer and
    > > > the Session_End seemed like the perfect thing but the
    > > > wretch event just won't fire. Then I tried intecepting the
    > > > Page_Unload event of one of my web forms and I get an
    > > > error! What is it about trying to find out when the
    > > > session ends or someone closes their browser that is such
    > > > a pain to intercept?

    > >
    > >

    >
    >
     
    William F. Robertson, Jr., Aug 15, 2003
    #3
  4. Kevin Spencer

    Tracey Guest

    Thank-you for replying. So what about a way to know when
    they have actually closed their browser? Is there a way to
    let my application know that the user has basically ended
    their session by closing their browser?

    >-----Original Message-----
    >Session_End is called in one of two ways.
    >
    >1. Session.Abandon() is called from the codebehind file.
    >2. The timeout has occured for the session.
    >
    >These are the only two reasons. (or if the application

    restarts)
    >
    >You will have to leave your debugger open for the timeout

    period (default of
    >20 minutes). But don't close the browser window out. It

    will stop the
    >debugger if you are using Studio.
    >
    >HTH,
    >
    >bill
    >
    >
    >
    >"Tracey" <> wrote in message
    >news:05c901c36343$f97ccc10$...
    >> Hey folks, I've got an ASP.NET application running just
    >> fine and I want to handle the Session_End event, but the
    >> event just isn't firing. I can put a break point there

    or
    >> save a row to a log table and neither of these show the
    >> event firing. What is wrong here? Has someone actually
    >> trapped this event? Is there some trick to getting this
    >> thing to work? Is there a bug? What?
    >>
    >> I want to know when the client closes his/her explorer

    and
    >> the Session_End seemed like the perfect thing but the
    >> wretch event just won't fire. Then I tried intecepting

    the
    >> Page_Unload event of one of my web forms and I get an
    >> error! What is it about trying to find out when the
    >> session ends or someone closes their browser that is

    such
    >> a pain to intercept?

    >
    >
    >.
    >
     
    Tracey, Aug 15, 2003
    #4
  5. I was painting in broad strokes there, bill. What I meant was, the event
    occurs on the server side, not on the client. I don't know of any
    documentation that details exactly when the Response is streamed to the
    browser. I know that if Response.BufferOutput is turned off, parts of the
    Response are indeed streamed to the browser during Page execution. However,
    if it is turned on, I don't know exactly when it occurs.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Neither a follower nor a lender be.

    "William F. Robertson, Jr." <> wrote in message
    news:...
    > Kevin,
    >
    > I thought the page was sent to the browser in the Render event.
    >
    > Does the HtmlTextWriter hold the reponse data until after Page_Unload is
    > called, and then flush it to the browser?
    >
    > If this is the default behavior, is it overridden when the Response.Flush

    is
    > called?
    >
    > bill
    >
    > "Kevin Spencer" <> wrote in message
    > news:...
    > > Also, the Page_Unload Event fires BEFORE the page is even returned to

    the
    > > browser. It is the event that is fired when the Page Class is unloaded

    > after
    > > execution.
    > >
    > > --
    > > HTH,
    > >
    > > Kevin Spencer
    > > Microsoft MVP
    > > .Net Developer
    > > http://www.takempis.com
    > > Neither a follower nor a lender be.
    > >
    > > "William F. Robertson, Jr." <> wrote in message
    > > news:...
    > > > Session_End is called in one of two ways.
    > > >
    > > > 1. Session.Abandon() is called from the codebehind file.
    > > > 2. The timeout has occured for the session.
    > > >
    > > > These are the only two reasons. (or if the application restarts)
    > > >
    > > > You will have to leave your debugger open for the timeout period

    > (default
    > > of
    > > > 20 minutes). But don't close the browser window out. It will stop

    the
    > > > debugger if you are using Studio.
    > > >
    > > > HTH,
    > > >
    > > > bill
    > > >
    > > >
    > > >
    > > > "Tracey" <> wrote in message
    > > > news:05c901c36343$f97ccc10$...
    > > > > Hey folks, I've got an ASP.NET application running just
    > > > > fine and I want to handle the Session_End event, but the
    > > > > event just isn't firing. I can put a break point there or
    > > > > save a row to a log table and neither of these show the
    > > > > event firing. What is wrong here? Has someone actually
    > > > > trapped this event? Is there some trick to getting this
    > > > > thing to work? Is there a bug? What?
    > > > >
    > > > > I want to know when the client closes his/her explorer and
    > > > > the Session_End seemed like the perfect thing but the
    > > > > wretch event just won't fire. Then I tried intecepting the
    > > > > Page_Unload event of one of my web forms and I get an
    > > > > error! What is it about trying to find out when the
    > > > > session ends or someone closes their browser that is such
    > > > > a pain to intercept?
    > > >
    > > >

    > >
    > >

    >
    >
     
    Kevin Spencer, Aug 15, 2003
    #5
    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. Chris Sibel

    Session_End Not Firing

    Chris Sibel, Jul 2, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    2,014
    Naveen K Kohli
    Jul 2, 2003
  2. Kenn Ghannon

    Session_End never fires

    Kenn Ghannon, Jul 8, 2003, in forum: ASP .Net
    Replies:
    9
    Views:
    513
    Kevin Spencer
    Jul 10, 2003
  3. Burak Kadirbeyoglu

    session_end and re-login

    Burak Kadirbeyoglu, Jul 10, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    609
    Tu-Thach
    Jul 10, 2003
  4. Steve M
    Replies:
    5
    Views:
    580
    Yan-Hong Huang[MSFT]
    Jul 31, 2003
  5. Steve Donnelly
    Replies:
    0
    Views:
    2,137
    Steve Donnelly
    Aug 30, 2003
Loading...

Share This Page