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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing all session variables

Status
Not open for further replies.

jwpward

Programmer
Sep 5, 2003
45
GB
Hi

I've just finished writing a psychometric test using asp.net with c#. There are 70 questions spread out over 14 pages or so. I'm using session variables to capture the answer to each question - either a or b. At the end it writes all answers back to the database using a stored procedure, and then I'm using Session.RemoveAll() to clear the session, but it doesn't seem to be working.

If I delete all temporaty internet files from explorer, it resets it and it works fine, otherwise the number of answers i enter get added on to the last time the test was completed. Can't quite work out why this is happening. Any suggestions would be gratefully accepted.

Thanks a lot
 
how about
Session.Abandon();
This will destroy all objects stored in a Session object and release their resources.
hth,
Marty
 
Thanks for that. I tried Session.Clear() earlier and that seems to work fine. Not sure why it wasn't working before - bit random.

Anyway, thanks for your input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top