session on end

S

Stephanie Stowe

http://www.aspfaq.com/show.asp?id=2078

I got my butt whooped over at asp.net group the other day with an offhanded
reference to the unreliability of session on end. I have been told that in
ASP IIS 5 and beyond, it IS reliable and DOES fire. What's the real word?

Thanks
 
B

Bob Barrows [MVP]

Stephanie said:
http://www.aspfaq.com/show.asp?id=2078

I got my butt whooped over at asp.net group the other day with an
offhanded reference to the unreliability of session on end. I have
been told that in ASP IIS 5 and beyond, it IS reliable and DOES fire.

I don't understand. The article DOES say that IIS5+ is less unreliable in
this regard than earlier versions. What is the controversy?
What's the real word?

The real word is that it may not fire when you want or expect it to fire.
For example, it will not immediately fire when a user closes his browser, so
if you are expecting to do user-tracking in this event, expect it to not be
accurate.

You need to keep in mind that only two events will cause session_onend to
fire:
1. The session times out
2. A Session.Abandon statement is executed

Other events, such as the user closing his browser or navigating to another
website, will not end the session until the timeout period expires.


Bob Barrows
 
S

Stephanie Stowe

Bob Barrows said:
I don't understand. The article DOES say that IIS5+ is less unreliable in
this regard than earlier versions. What is the controversy?

Less unreliable is not the same as reliable!
The real word is that it may not fire when you want or expect it to fire.
For example, it will not immediately fire when a user closes his browser, so
if you are expecting to do user-tracking in this event, expect it to not be
accurate.

Will it fire when the session times out? Consistently?
You need to keep in mind that only two events will cause session_onend to
fire:
1. The session times out
2. A Session.Abandon statement is executed

Other events, such as the user closing his browser or navigating to another
website, will not end the session until the timeout period expires.

Sure enough.
 
B

Bob Barrows [MVP]

Stephanie said:
Less unreliable is not the same as reliable!

I should let him speak for himself, but I'm thinking that Aaron is saying
that it is not reliable if the developer is expecting it to fire in
circumstances where it is not supposed to fire.
Will it fire when the session times out? Consistently?

In my experience: yes.

I've never encountered the situations described in Aaron's FAQ article. I've
never seen any documented reports of it failing to fire under IIS5 and
higher. Of course, I haven't been looking for them ...

Bob Barrows
 
S

Stephanie Stowe

Bob Barrows said:
I should let him speak for himself, but I'm thinking that Aaron is saying
that it is not reliable if the developer is expecting it to fire in
circumstances where it is not supposed to fire.


In my experience: yes.

I've never encountered the situations described in Aaron's FAQ article. I've
never seen any documented reports of it failing to fire under IIS5 and
higher. Of course, I haven't been looking for them ...


Cool. That's what I needed to know.
 
P

Patrice

I've seen this reported many times myself over years (though I don't use
this event).

Could it be then some kind of Urban Legend forged by those who was expected
to see it fire when it is not supposed to fire ;-) !!!!

Patrice
 
S

Stephanie Stowe

For me, reading the faq article, seeing the very first sentences:

"Session_OnEnd is unreliable. Do not create applications that rely on
Session_OnEnd to occur, because it doesn't always happen. "

Followed by:

"This is a known bug and seems to have been reduced (if not eliminated
entirely) in IIS 5.0, which ships with Windows 2000. "

Aaron's faq has given me countless pieces of great info. So when he said "
is unreliable" and "seems to have been reduced" it did not give me the warm
fuzzies.

Aaron, if you are reading this, do not take this as a criticism. I love your
faq.

Stephanie
(same Stephanie as days gone by in a new job back in ASP land.)
 

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
474,266
Messages
2,571,082
Members
48,773
Latest member
Kaybee

Latest Threads

Top