Friday 1 September 2017

How to Kill A Session or Session ID (ASP.NET/C#)

Below are the differnt ways to remove the sessions:- 

1. Session.Remove(strSessionName); -> Removes an item from the session state collection. 
2. Session.RemoveAll() -> Removes all items from the session collection. 
3. Session.Clear() -> Remove all items from session collection. Note: There is no difference between Clear and RemoveAll. RemoveAll() calls Clear() internally. 
4. Session.Abandon() - > Cancels the current session.

No comments:

Post a Comment