Session_OnEnd not firing sometimes?

C

Chris Ashley

There seem to be isolated occurences of Session_OnEnd not firing in my
app. This is problematic because some clean up of resources happens
here. I know the Session events were unreliable in classic ASP, but is
this still the case in ASP.Net?

What kind of scenarios would case Session_OnEnd not to fire? Would
Application_Error being hit cause Session_OnEnd not to fire?
 
M

Michael Nemtsev [MVP]

Hello Chris,

yep, it's still not relyable.
1) it works only for the InProc session management
2) With some SP (for VS or for Windows) it doesn't work at all - need hotfix




---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


CA> There seem to be isolated occurences of Session_OnEnd not firing in
CA> my app. This is problematic because some clean up of resources
CA> happens here. I know the Session events were unreliable in classic
CA> ASP, but is this still the case in ASP.Net?
CA>
CA> What kind of scenarios would case Session_OnEnd not to fire? Would
CA> Application_Error being hit cause Session_OnEnd not to fire?
CA>
 
C

Chris Ashley

Hi michael,

Thanks for your response.

Is there any alternative? Maybe I could store some object in the
session and have its finalizer do the clear up? Would this work, so
when it is garbage collected (presumably at some point after there is
no reference to it in Session scope), my clean up will happen because
GC will call it's finalizer?
 
M

Michael Nemtsev [MVP]

Hello Chris,

You can use Application and Cache instead

read the MSDN to get more info about this


---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


CA> Hi michael,
CA>
CA> Thanks for your response.
CA>
CA> Is there any alternative? Maybe I could store some object in the
CA> session and have its finalizer do the clear up? Would this work, so
CA> when it is garbage collected (presumably at some point after there
CA> is no reference to it in Session scope), my clean up will happen
CA> because GC will call it's finalizer?
CA>
Hello Chris,

yep, it's still not relyable.
1) it works only for the InProc session management
2) With some SP (for VS or for Windows) it doesn't work at all - need
hotfix
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog:http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

CA> There seem to be isolated occurences of Session_OnEnd not firing
in
CA> my app. This is problematic because some clean up of resources
CA> happens here. I know the Session events were unreliable in
classic
CA> ASP, but is this still the case in ASP.Net?
CA>
CA> What kind of scenarios would case Session_OnEnd not to fire?
Would
CA> Application_Error being hit cause Session_OnEnd not to fire?
CA>
 
H

Hal Rosser

Chris Ashley said:
There seem to be isolated occurences of Session_OnEnd not firing in my
app. This is problematic because some clean up of resources happens
here. I know the Session events were unreliable in classic ASP, but is
this still the case in ASP.Net?

What kind of scenarios would case Session_OnEnd not to fire? Would
Application_Error being hit cause Session_OnEnd not to fire?

I think the Session timeout can be set on the server,
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top