Session Clear and Session Abandon ASP.Net



Session.Clear() and Session.Abandon()

we learnt about session object and session timeout properties from our previous asp.net post. Now, in this asp.net tutorial we learn about session.clear and session.abandon method in detail.

Session.Abandon()

  • Session.Abandon() method used to destroys the session by generating a Session_End event
  • Session.Abandon() method used to destroy the current session.
  • It is same things to dispose of an object.
  • It trigger Session_End event Global.asax.
  • Session.Abandon() method clear occupied memory location.

Session.Clear()

  • Session.Clear() used to just clears all values of session without destroying it.
  • It is same things to assigning null value to a variable.
  • It doesn’t trigger Session_End in Global.asax.
  • Session.Clear() method just clear session values.
(Visited 238 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha *