To end a session immediately, you may use the Abandon method:
<%
Session.Abandon
%>
To remove all variables in a session, use the RemoveAll method:
<%
Session.Contents.RemoveAll()
%>
To remove a session var:
<%
Session.Contents.Remove("varName")
%>
My Opinion: Cookies should remain something you eat. Advances in server side code have left you very few occasions when you may need to use them Eg 'tick this box to remember my log in details'. Using cookies inhibbits the portability of your web pages. Use then but dont rely on them. If you do rely on them, you are restricting your viewable audience.
Have you got your time out set to less than the default 20 mins? if so, you are restricting your users from making a cofee and being able to come back to your web page to continue thier experience on your site. A personal turn off for me
Lastly, it's mostly frugal people who say session vars are bad and exhaustive on resources, true they are but - there are things you can do to make the use of them effectivly, i'll let you research that one (EG clear them once youve finished with them)
Solution, instead use:
a.. Constants
b.. hidden form variables
c.. Querystrings
Wind is your friend
Matt
|