Code to clear or expire session in Asp.net

If you want to clear or expire session in Asp.net page than you can try following code hints.
Seesion.Abandon();
Response.Cookies.Clear();

To make session expire
HttpCookie YourCookie;
YourCookie.Expires = DateTime.Now.AddDays(-1);

Comments