[thelist] [ASP Question] Session_OnEnd

David at softv.net David at softv.net
Fri Oct 18 15:25:01 CDT 2002

Hi Jaques,

Why not set a cookie when the user hits the site (ASP sessions use cookies
anyway to identitfy users) and set the current/date time in that cookie.
Right before the session is destroyed, grab the associated cookie and do a
compare of the date/time stored in it with the current date/time.
Keep in mind as well that sessions expire by default after 20 minutes of
inactivity on the server, although this can be adjusted.

David Mitchell
Application Developer
david at sofTV.net
613.729.6400 x268

-----Original Message-----
From: Jacques Capesius [mailto:jacques_capesius at cnt.com]
Sent: Friday, October 18, 2002 3:01 PM
To: 'thelist at lists.evolt.org'
Subject: [thelist] [ASP Question] Session_OnEnd

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.

For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !

More information about the thelist mailing list