通过IFRAME加载非本域名下的页面时,如果需要写入cookie信息。IE浏览器的安全机制将会阻止,cookie的写入。这可以通过观察浏览器状态栏中右下角图,双击打开后类似于下图。

经测试,FireFox及Chrome没有问题。
解决办法:
需要在IFRAME加载的页面中,按下面的方式,增加header头。

PHP:

header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');

ASP.NET:

HttpContext.Current.Response.AddHeader("p3p","CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");

Django:

response = render_to_response('mytemplate.html')
response["P3P"] = 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'

JSP:

response.addHeader("P3P","CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"")