This just a small snippet to add, clear and remove all the session values in C#.

To add and remove a session value

To add

Session[“username”] = “JonDoe”;

To Remove

Session[“username”] = “”;

To clear and remove all the session values

Session.Contents.RemoveAll();

Session.Abandon();