Setting a Session Variable
Here is the scripting that sets the session variable:
The former is good if you still need other information from the session, if your session isn't done
and you don't want your global.asa (if you're using one) Session_onEnd code to fire.
The latter option destroys all objects created by the session, and frees up resources.
If you're using a global.asa, session.abandon will cause the Session_OnEnd code to fire, just as it
would if the session timed out normally.
A side note here: By default, sessions time out after 20 minutes after the user's last request for a
page. This can be modified by using the Timeout property (if you just want it to apply to one particular application);
if you want to change this globally you can do this through the MMC or in the registry. If you anticipate
particularly heavy traffic on your site, you might want to lower the default timeout; see Microsoft's
Optimizing ASP Performance. Also,
for more info on sessions, see Charles Carroll's
Session Overview & Myths.
|