[thelist] [ASP Question] Session_OnEnd

Chris Blessing webguy at mail.rit.edu
Fri Oct 18 15:23:16 CDT 2002


You are correct, the SID will become invalid before the onend event fires.
The only way I know of to get around this is to store the sid (or perhaps a
unique identifier from your session_states table).  Some might say that's a
bit insecure, being that it's a simple cookie an all... I suppose you could
encrypt the SID/uniqueidentifier.

HTH!

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

> sorry to keep bugging you folks with these stupid questions and thanks for
> your continued help. I did get the Session_OnStart event to work by moving
> it to the global.asa file in which it resides to the root web directory. I
> have a new question tho.
>
> I now have a Session_OnEnd event I want to grab and when that happens, run
> the following chunk of code:
>
> SQLQuery = "UPDATE Session_States "&_
> 	     "SET session_end = getdate() "&_
> 	     "WHERE session_ID = '"&Session.SessionID&"'"
>
> now... I'm thinking that since it's the ending of the session that's the
> event, and this happens after the session has ended, the sessionID I'm
> trying to grab will have already been discarded and this code will be
> patently useless. Is this true? If it is, I'll need to come up with some
> other way to grab the amount of time people are spending on the
> website I'm
> popping this stuff on. thanks again, all.




More information about the thelist mailing list