Wednesday, June 26, 2013

Disabling Browsers Back Functionality to logout in asp .net

 

In page_load of login page add

      System.Web.Security.FormsAuthentication.SignOut();
      Session.Clear();
      Session.Abandon();
In page_load of master page add:
      Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
      Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
      Response.Cache.SetNoStore();

No comments:

Post a Comment