Internet explorer IE在iframe页面(SSL)上悄悄删除cookie?

Internet explorer IE在iframe页面(SSL)上悄悄删除cookie?,internet-explorer,iframe,ssl,cookies,forms-authentication,Internet Explorer,Iframe,Ssl,Cookies,Forms Authentication,我对多域web应用程序中的iFrame和Cookie有问题。 在开始之前,我非常清楚domain1上的application1无法访问或设置domain2上application2的cookie。所以这不是初学者的问题 问题如下: 我有一个网站,位于 以及reportserver网站2,位于 问题的缩小版本是: 我把这个内容 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xh

我对多域web应用程序中的iFrame和Cookie有问题。 在开始之前,我非常清楚domain1上的application1无法访问或设置domain2上application2的cookie。所以这不是初学者的问题

问题如下: 我有一个网站,位于

以及reportserver网站2,位于

问题的缩小版本是:

我把这个内容

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Test Page</title>
    </head>

<body>
    <iframe src="www8.company-asp.ch/ReportServer/login.aspx" width="1000" height="1000" ></iframe>
</body>
</html>
输入带有URL的ifrm.html文件

现在,无论我在reportserver表单上以用户名/密码的形式输入什么,它都不起作用。用户名和密码都是120%正确的,并且存在并拥有所有必要的权限。

如果我在Google Chrome或Firefox上做同样的事情,那么它就可以工作了,我可以登录iframe中包含的报表应用程序

但在Internet Explorer中,您可以尝试登录,但始终停留在登录屏幕上,因为未知原因,它要么不创建cookie,要么不发送cookie

如果我在iframe之外运行reportserver,我可以登录并在internetexploder中打开报告。 请注意,ReportServer在使用Cookie的窗体身份验证上运行,而不是在Windows身份验证上运行

此外,这个问题并不局限于ReportServer,我可以将任何使用Cookie进行身份验证的应用程序放在那里,它们也会失败得很惨——但只有在InternetExplorer中,Chrome和Firefox中的一切都可以正常工作

我觉得这很奇怪,因为-如果我在上运行相同的应用程序site1 并使reportserver位于同一域中的 ,然后它就工作了

除了IE是一个sh*t软件这一事实之外,有人知道问题是什么或可能是什么吗? 我能想到的唯一区别是工作变量和非工作变量之间的区别是,主域和子域在两个示例中是不同的。 这是IE=Severy bug?中的按设计SSL问题,还是SSL/SSL证书配置错误的问题

编辑: 是的,我知道我可以在中禁用它,但这不是一个可接受的解决方案。我不能告诉客户让他的所有员工在他们的IE中更改此设置。首先,这是行不通的,其次,他们可能无权更改这些设置,第三,IT部门可能出于任何原因不允许,第四,因为要求客户更改浏览器的设置是愚蠢的。。。

编辑2: 情况变得更糟了。它是P3P,我通过web.config使用P3P头在我的测试域上工作。 但是不能在ReportServer的web.config中添加P3P头,因为它运行在某种内部IIS6上。

尝试以下方法:

1.打开Internet Explorer,选择工具| Internet选项

2.单击安全选项卡

3.选择互联网专区

4.向下滚动以在IFRAME中启动程序和文件

5.选择启用


6.单击“确定”

这确实是我们的工作。 超级巨魔级

解决此问题的明智方法通常是向web.config文件的system.webServer部分添加自定义头

<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>


    <httpProtocol>
        <customHeaders>
          <add name="p3p" value="CP=&quot;IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT&quot;"/>
        </customHeaders>
    </httpProtocol>
</system.webServer>
然后可以在ReportServer的web.config文件中添加CustomHttpHeaderModule。 Weeeee:O=

  [...]
  <httpModules>
    <clear />
    <add name="CustomHttpHeaders" type="CustomHttpHeaders.CustomHttpHeaderModule, CustomHttpHeaders" />
  </httpModules>

</system.web>
如果要在Visual Studio 2013 IIS Express中对其进行调试,还需要在web.config文件中进行调试

<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>

<modules runAllManagedModulesForAllRequests="true" >
  <add name="CustomHttpHeaders" type="CustomHttpHeaders.CustomHttpHeaderModule, CustomHttpHeaders" />
</modules>


<!--
<httpProtocol>
  <customHeaders>
      <add name="p3p" value="CP=&quot;IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT&quot;"/>
  </customHeaders>
</httpProtocol>
-->

嗯,也许p3p很棒,那么它可以在我的电脑上运行,但不能在客户电脑上运行;如果您将此称为解决方案,请提供一个零天漏洞,您可以将其放在执行此操作的基本页面上。实际上,它位于隐私->高级->禁用自动cookie处理下
  [...]
  <httpModules>
    <clear />
    <add name="CustomHttpHeaders" type="CustomHttpHeaders.CustomHttpHeaderModule, CustomHttpHeaders" />
  </httpModules>

</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>

<modules runAllManagedModulesForAllRequests="true" >
  <add name="CustomHttpHeaders" type="CustomHttpHeaders.CustomHttpHeaderModule, CustomHttpHeaders" />
</modules>


<!--
<httpProtocol>
  <customHeaders>
      <add name="p3p" value="CP=&quot;IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT&quot;"/>
  </customHeaders>
</httpProtocol>
-->