如何确保 IE 8 永远不会缓存我的数据
我有以下 2 个页面:
- check-cookie.html,它检查用户是否有给定的 cookie
- set-cookie.html,它设置给定的用户 cookie
在 IE 8 中,我使用空缓存/cookie 执行以下操作文件:
- 加载 check-cookie.html。我得到“无 cookie”输出,如预期的
- Load set-cookie.html,它设置用户 cookie
- Load check-cookie.html。我得到正确的“cookie present”输出
- 删除我的cookie并清除缓存。
- 重新加载 check-cookie.html。即使我的 cookie/缓存是清晰的,我仍然得到“cookie present”输出。
- 关闭 IE8 浏览器并重新打开,加载 check-cookie.html。我现在得到“无 cookie”输出。
Microsoft 网站对此进行了记录:http://windows.microsoft。 com/en-us/Windows7/Delete-webpage-history。
本质上,即使缓存文件已被清除,但其中一些文件仍存储在内存中,因此您需要关闭浏览器才能完全清除缓存。有谁知道如何绕过这个 IE 限制?
仅供参考,我使用以下无缓存标头: 缓存控制:无缓存、无存储、必须重新验证、后检查=0、预检查=0 编译指示:无缓存
I have the following 2 pages:
- check-cookie.html, which checks to see if a user has a given cookie
- set-cookie.html, which sets a given user cookie
In IE 8, I do the following with an empty cache/cookie file:
- Load check-cookie.html. I get a 'no cookie' output, as expected
- Load set-cookie.html, which sets a user cookie
- Load check-cookie.html. I get the correct 'cookie present' output
- Delete my cookies and clear the cache.
- Reload check-cookie.html. I still get 'cookie present' output, even though my cookie/cache are clear.
- Close the IE8 browser and reopen it, loading check-cookie.html. I now get a 'no cookie' output.
This is documented on the Microsoft site here: http://windows.microsoft.com/en-us/Windows7/Delete-webpage-history.
Essentially, even though the cache files have been cleared, some of it is stored in memory so you need to close the browser to clear the cache fully. Does anyone know how to get around this IE limitation?
FYI, I am using the following no cache headers:
Cache-Control: no-cache,no-store,must-revalidate,post-check=0,pre-check=0
Pragma: no-cache
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 cookie 可能是会话 cookie,而不是持久 cookie。 IE 中的“缓存”指的是 Internet 临时文件文件夹。会话cookie仅存储在内存中,当浏览器运行时,仅持久cookie存储在缓存中。
IE8 中没有选项可以删除所有会话 cookie。删除 cookie 功能仅删除“存储在您的计算机上”的 cookie,即您的临时 Internet 文件文件夹中的持久 cookie。
您的会话cookie没有被缓存,我认为您对“缓存”的期望/解释让您感到困扰。
您是否有更高级别的问题或者您认为需要解决?我认为会话 cookie 没有问题,只有在浏览器退出时才会被丢弃。什么场景?
Your cookie is probably a session cookie and not a persistent cookie. "The Cache" in IE refers to your Temporary Internet Files folder. Session cookies are only stored in memory, whilst the browser is running, only persistent cookies are stored in the cache.
There is no option in IE8 to delete all your session cookies. The delete cookies function only deletes cookies "stored on your computer", meaning, persistent cookies in your Temporary Internet Files folder.
Your session cookies are not being cached, I think it is your expectation/interpretation of "cache" that is troubling you.
Do you have a higher-level problem or that you believe needs to be fixed? I see no issue in session cookies only being discarded when the browser exits. What's the scenario?