IE 和 Safari 浏览器在 iframe 中阻止跨域 cookie。
例如,我有两个网站,假设它们是example.com
和anotherexample.net
。
在example.com
,我有一个页面http://example.com/someform.asp
,在这个页面中我使用 cookie。当我http://example.com/someform.asp
直接在浏览器中打开时,它工作正常。
在anotherexample.net
,我有页面http://anotherexample.net/page.asp
,这个页面包含一个IFRAME SRC="http://example.com/someform.asp"
. 现在,当我们http://anotherexample.net/page.asp
在浏览器中打开页面时,cookieexample.com
不会保存。在 Firefox 和 chrome 中不会出现这个问题。
我发现使用 p3p 策略我们可以解决这个问题,但是在 IIS 响应标头中设置低于 p3p 策略后,它仅适用于 IE。
P3P : CP="This is a P3P policy! See http://www.workplaceanswers.com/privacy-and-terms/"
但是,我在 Safari 中仍然遇到同样的错误。我尝试了如下不同的 p3p 策略值,但无法修复它。
P3P : CP="CUR ADM DEV HIS TEL STA STP COM”
P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT”
P3P:CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA”
有什么办法可以在 Safari 中完成这项工作吗?