由于网页的缓存版本,我如何消除安全风险 [英] how do i remove the security risk, due to cached version of page

查看:75
本文介绍了由于网页的缓存版本,我如何消除安全风险的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参考链接

why does the value of session variable remain even after all the code of destruction?

问题是我做的登录功能失败,因为浏览器显示页面的缓存版本,我也不知道为什么在一定时间内可以执行所有功能限制,然后重新实现它!!

in the above the problem is that login function made by me fails, as the browser is displaying the cached version of the page, which also I DO NOT KNOW WHY is capable of performing all the functions for a certain time limit, after which it REALIZES THAT ITS CACHED!!

因此,

如何删除缓存的该网站,

how to remove the cached version of the website,

如何告诉您不要在缓存中进行复制!

how to tell DO NOT MAKE MY COPY IN CACHE!!!

通过使用c#

推荐答案

您最多可以做的是将expires元标记添加到您不希望浏览器缓存的页面

Most you can do is add expires meta tag to the pages that you don't want browser to cache

<META HTTP-EQUIV="EXPIRES" CONTENT="0">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="No-Cache, No-Store">

或在添加页面标记后在ASP.NET中替代

Or alternately in ASP.NET after Page tag add

<%@ OutputCache Duration="0" Location="none" NoStore="true" %>

在C#后面的代码中

Response.Cache.SetNoStore();
Response.Cache.SetExpires(DateTime.Now);
Response.Cache.SetCacheability(HttpCacheability.NoCache);

有关更多信息,请参考 http://msdn.microsoft.com/zh-cn/library/06bh14hk(v = VS.100).aspx

For more information refer to http://msdn.microsoft.com/en-us/library/06bh14hk(v=VS.100).aspx

此处的详细文章 http:// www.mnot.net/cache_docs/

编辑:在Alxandr发表评论后更新

Updated after comments from Alxandr

这篇关于由于网页的缓存版本,我如何消除安全风险的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆