zoukankan      html  css  js  c++  java
  • 转载:IE Blocking iFrame Cookies

    IE Blocking iFrame Cookies

    Written by adam on Tue, 09/16/2008 - 13:52

    I got a call today about one of my applications not running correctly from inside an iFrame. I tried it out and it looked like everything worked great in Safari and Firefox but not IE6 or IE7. It took me a few failed attempts to fix it before I decided it must be a session problem. After firing up a packet sniffer it became obvious the cookie with the session ID was not being passed.

    The problem lies with a W3C standard called Platform for Privacy Preferences or P3P for short. You can read all about the boring stuff via the link or else just install the P3P Compact Policy header below. This will allow Internet Explorer to accept your third-party cookie. You will need to send the header on every page that sets a cookie.Just add this to the start of your page (every page where cookies will be written):

    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(加入session提交页面的<%     %>之间):

    response.addHeader("P3P","CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"")
  • 相关阅读:
    搭建 structs2 环境
    数据库基础
    好书推荐整理
    Java 完美判断中文字符
    中文在unicode中的编码范围
    [转载]爬虫的自我解剖(抓取网页HtmlUnit)
    web应用配置
    简单的Java Web服务器
    dos基本命令
    Unrecognized Windows Sockets error: 0: JVM_Bind
  • 原文地址:https://www.cnblogs.com/moonson/p/2254438.html
Copyright © 2011-2022 走看看