Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear Sessions

Status
Not open for further replies.

Joulius

Programmer
Dec 16, 2003
215
RO
I have an application that uses several Session.Item objects to keep track of logged user's prefferances. Once the user uses the "logout" option, the page is redirected to a logout.aspx page that contains this code inside the page_load sub :
Session.RemoveAll()
Response.Redirect("default.aspx")
I have some doubts that this does what is intended to do, so that's why I'm asking what's the best way to clear all session items at once.
Thanks in advance!
 
I forgot to mention that I'm using VB .NET as codebehind language.
 
Jou: I have tested Session.RemoveAll on many occassions and in each case there were no Session variables remaining immediately after the execution of this command. In my opinion it does the job - I cannot think of any situations in which it does not.
 
Seems that you're right Isa. The only moment when it seems that the sessions are not removed is when i run the application in debug mode. I got to find out why!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top