Friday, August 16, 2013

Disabling Browsers Back Functionality For Proper 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();