Session.RemoveAll (); //Removes all session variables
or use
Session.Clear();
if you use Formsauthentication use
FormsAuthentication.SignOut(); Shown below:
protected void LogoutButton_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Response.Redirect("~/Login.aspx");
}
(or)
If you click backbutton of browser, page loads from cache..So Label and other controls will dispaly previous values.
to avoid this..add this code to Page_Load..
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoServerCaching();
HttpContext.Current.Response.Cache.SetNoStore();