是否可以在IE11中阻止cookie

问题描述 投票:0回答:1

我正在测试(在Windows 7 64位上的localhost上)阻止cookie时我的Web应用程序的行为。

当在IE11上进行测试时,似乎你无法阻止cookie,即使IE11设置显示我已经阻止了cookie。(我还尝试卸载并重新安装IE11,以防万一被破坏,但无法阻止cookie。)

我研究过以下几个地方但没有答案;

  1. Cookies disable doesn't work in Internet Explorer 11 using advance setting
  2. Cookie disabled issue in IE
  3. document.cookie is still accessible on IE11, even though cookies are disabled
  4. https://superuser.com/questions/1000545/internet-explorer-11-cant-disable-localhost-cookies

或者我应该忘记Internet Explorer? (提前感谢编码社区)

internet-explorer-11
1个回答
0
投票

我认为你和我面临同样的问题。我搜索了很多。我发现,Cookie设置只对包含真实域名的网站产生影响(例如:examples.com,abc.net,...)

  1. 您可以通过编辑(C:\ Windows \ System32 \ drivers \ etc)中的主机文件来更改localhost域
  2. 在该文本文件的末尾包含一行,如下所示:

127.0.0.1 test Web.net

现在,无论何时键入testweb.net,它都将返回与localhost相同的页面。

© www.soinside.com 2019 - 2024. All rights reserved.