What is the difference between Session.Abandon() and Session.Clear()?

 Posted by Tripati_tutu on 4/30/2011 | Category: ASP.NET Interview questions | Views: 6777 | Points: 40

Session.Abandon() will end current session by firing Session_End and in the next
request, Session_Start will be fire.

Session.Clear( ) just clears the session data without killing it. With session.clear
variable is not removed from memory it just like giving value null to this session.

Session ID will remain same in both cases, as long as the browser is not closed.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Lokesh76 on: 5/4/2011 | Points: 10
Good question and explaination too. thanks
Posted by: Tripati_tutu on: 5/6/2011 | Points: 10
Thanks Lokesh ...
Posted by: Shoeb2222 on: 6/22/2011 | Points: 10
Thanks for explaining in a very clear cut way, it helps me.

Login to post response