Session variables and Session_OnEnd

Discussion in 'ASP .Net' started by Hans Kesting, Aug 18, 2003.

  1. Hans Kesting

    Hans Kesting Guest

    Hi,

    When the Session_OnEnd event fires, do the Session variables still exist?
    I want to do some cleanup (update some records in a database etc.),
    but then I need to know *which* recopds to update ...

    Can I access these session variables through HttpContext.Current.Session ?
    (the cleanup-code is in a separate class, which is defined within the
    website)


    Hans Kesting
    Hans Kesting, Aug 18, 2003
    #1
    1. Advertising

  2. Hi

    You can access Session Variables through
    HttpContext.Current.Session.

    Ravikanth

    >-----Original Message-----
    >Hi,
    >
    >When the Session_OnEnd event fires, do the Session

    variables still exist?
    >I want to do some cleanup (update some records in a

    database etc.),
    >but then I need to know *which* recopds to update ...
    >
    >Can I access these session variables through

    HttpContext.Current.Session ?
    >(the cleanup-code is in a separate class, which is

    defined within the
    >website)
    >
    >
    >Hans Kesting
    >
    >
    >.
    >
    Ravikanth[MVP], Aug 18, 2003
    #2
    1. Advertising

  3. Hans Kesting

    Hans Kesting Guest

    Yes, I know, I already use that.
    But: are those session variables *still* available when handling the
    Session_OnEnd event?

    Or to put it in another way: exactly *when* is this event fired?
    - right after the session has expired (so any stored variables are gone), or
    - just before expiring (so that any stored variables are still available)

    I hope the second one is true, as that is the most useful.

    Hans Kesting

    "Ravikanth[MVP]" <> wrote in message
    news:0ad701c365a4$b26e7090$...
    > Hi
    >
    > You can access Session Variables through
    > HttpContext.Current.Session.
    >
    > Ravikanth
    >
    > >-----Original Message-----
    > >Hi,
    > >
    > >When the Session_OnEnd event fires, do the Session

    > variables still exist?
    > >I want to do some cleanup (update some records in a

    > database etc.),
    > >but then I need to know *which* recopds to update ...
    > >
    > >Can I access these session variables through

    > HttpContext.Current.Session ?
    > >(the cleanup-code is in a separate class, which is

    > defined within the
    > >website)
    > >
    > >
    > >Hans Kesting
    > >
    > >
    > >.
    > >
    Hans Kesting, Aug 19, 2003
    #3
  4. Hans Kesting

    Natty Gur Guest

    MSDN :
    "The Session_OnEnd event occurs when a session is abandoned or times
    out. Of the server built-in objects, only the Application, Server, and
    *Session* objects are available. "

    Natty Gur, CTO
    Dao2Com Ltd.
    34th Elkalay st. Raanana
    Israel , 43000
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur, Aug 19, 2003
    #4
  5. Hans Kesting

    Hans Kesting Guest

    Thanks,

    I did search for it, but couldn't find the correct entry.

    Hans Kesting

    "Natty Gur" <> wrote in message
    news:...
    > MSDN :
    > "The Session_OnEnd event occurs when a session is abandoned or times
    > out. Of the server built-in objects, only the Application, Server, and
    > *Session* objects are available. "
    >
    > Natty Gur, CTO
    > Dao2Com Ltd.
    > 34th Elkalay st. Raanana
    > Israel , 43000
    > Phone Numbers:
    > Office: +972-(0)9-7740261
    > Fax: +972-(0)9-7740261
    > Mobile: +972-(0)58-888377
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Hans Kesting, Aug 19, 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. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    Session_OnEnd() - what session?

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Jul 16, 2006, in forum: ASP .Net
    Replies:
    11
    Views:
    643
    Steven Cheng[MSFT]
    Jul 18, 2006
  2. John H
    Replies:
    0
    Views:
    279
    John H
    Jun 24, 2009
  3. Soha El-Saeed

    Global.asa and Session_OnEnd

    Soha El-Saeed, Feb 4, 2004, in forum: ASP General
    Replies:
    1
    Views:
    145
    John Blessing
    Feb 4, 2004
  4. David Logan

    Session Data in Session_OnEnd

    David Logan, May 21, 2004, in forum: ASP General
    Replies:
    1
    Views:
    115
    Aaron Bertrand - MVP
    May 21, 2004
  5. HolaGoogle
    Replies:
    4
    Views:
    112
    HolaGoogle
    Nov 20, 2003
Loading...

Share This Page