Monday, 14 November 2011

ASP.NET authentication login and logout with browser back button

ASP.NET authentication login and logout with browser back button

private void Page_Load(object sender, System.EventArgs e)
{  
     // Put user code to initialize the page here
     Session.Abandon();
     FormsAuthentication.SignOut();
}
              OR
private void Page_Load(object sender, System.EventArgs e)
{
     Session.Abandon();
     Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
     Response.Cache.SetCacheability(HttpCacheability.NoCache);
     Response.Cache.SetNoStore();
}


Tag: Asp.net, browser back button, login, logout

No comments:

Post a Comment

Parsing JSON w/ @ symbol in it

To read the json response like bellow @ concatenated with attribute                             '{ "@id": 1001, "@name&q...