简体   繁体   English

asp.net中的主页浏览器缓存

[英]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. 我在asp.net中遇到的问题是,当我成功登录并在另一个浏览器上复制默认页面时,浏览器将显示默认页面。 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();

How are you checking the identity of authenticated users. 您如何检查经过身份验证的用户的身份。 have you denying anonymous users from web.config file? 您是否拒绝了web.config文件中的匿名用户? 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.. 您可以做的就是创建一个BasePage并从中检查您的安全性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM