Session.abandon and Session.Cleear: what is the difference

  • Thread starter Thread starter JJ_377
  • Start date Start date
J

JJ_377

What is the difference between Session.Abandon and Session.Clear?
Thank you.
 
Session.Abandon() will end current session
Session_End will be fired and next request will fire Session_Start

Session.Clear will just clear the session data , the session is still alive

Session ID will remain same in both cases, as long as the browser is not
closed.
 
Thank you - my further question,s what is recommended in terms of
clearing any session variables in the context of:
1. on error, I want any session variables cleared and the user
redirected to a logon page
( I wish to prevent a user from reentering the error page and
recreating the original error)
3. I wish to prevent others from "backing" into web pages if a user
does not log out and session timeout has not yet occurred.

I have the web pages set so that the browser will not cache them

It kind of sounds like I just need Session.clear, but I have been using
Session.Abandon.

MY thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top