Tuesday, March 13, 2012

Session variables and Session_OnEnd

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 KestingHi

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
>
>.
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]" <dvravikanth@.hotmail.com> wrote in message
news:0ad701c365a4$b26e7090$a501280a@.phx.gbl...
> 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
> >.
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]" <dvravikanth@.hotmail.com> wrote in message
news:0ad701c365a4$b26e7090$a501280a@.phx.gbl...
> 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
> >.
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!
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!
Thanks,

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

Hans Kesting

"Natty Gur" <natty@.dao2com.com> wrote in message
news:eRsVT9iZDHA.2020@.TK2MSFTNGP10.phx.gbl...
> 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!

0 comments:

Post a Comment