ezekiel
ezekiel

Reputation: 187

Main Page Browser Caching in asp.net

The problem I'm facing in my asp.net is when I logged in successfully and I copied the default page on another browser, the browser displays the default page. The other browser should display Login page. I'm using the below code in my site master but unfortunately its not working

  Response.Cache.SetAllowResponseInBrowserHistory(false);
  Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
  Response.AppendHeader("Pragma", "no-cache");
  Response.AppendHeader("Cache-Control", "no-store");

  Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
  Response.Cache.SetCacheability(HttpCacheability.NoCache);
  Response.Cache.SetNoStore();

Upvotes: 0

Views: 322

Answers (1)

Anupam Sharma
Anupam Sharma

Reputation: 368

How are you checking the identity of authenticated users. have you denying anonymous users from web.config file? or you have some kind of session or other checks on every page? What you can do is just create a BasePage and check your security from this..

Upvotes: 1

Related Questions