代码之家  ›  专栏  ›  技术社区  ›  Younes

Iframe表单不是在IE中提交的,而是在Firefox中工作的

  •  3
  • Younes  · 技术社区  · 14 年前

    这是我从小提琴手那里得到的:

    火狐

    职位:

    Ressult Protocol    Host    URL Body    Caching Content-Type    Process Comments    Custom  
    1   302 HTTP    www.dmg.eu  /brugman/budgetplanner/aanmelden.php    0   no-store, no-cache, must-revalidate, post-check=0, pre-check=0  Expires: Thu, 19 Nov 1981 08:52:00 GMT  text/html; charset=UTF-8    firefox:6116    
    

    #   Result  Protocol    Host    URL Body    Caching Content-Type    Process Comments    Custom  
    2   200 HTTP    www.dmg.eu  /brugman/budgetplanner/ 40.677  no-store, no-cache, must-revalidate, post-check=0, pre-check=0  Expires: Thu, 19 Nov 1981 08:52:00 GMT  text/html; charset=UTF-8    firefox:6116
    

    Internet Explorer

    职位:

    Result  Protocol    Host    URL Body    Caching Content-Type    Process Comments    Custom  
    73  302 HTTP    www.dmg.eu  /brugman/budgetplanner/aanmelden.php    0   no-store, no-cache, must-revalidate, post-check=0, pre-check=0  Expires: Thu, 19 Nov 1981 08:52:00 GMT  text/html; charset=UTF-8    iexplore:536    
    

    Result  Protocol    Host    URL Body    Caching Content-Type    Process Comments    Custom  
    74  302 HTTP    www.dmg.eu  /brugman/budgetplanner/ 0   no-store, no-cache, must-revalidate, post-check=0, pre-check=0  Expires: Thu, 19 Nov 1981 08:52:00 GMT  text/html; charset=UTF-8    iexplore:536    
    

    希望有人知道区别是什么:)。

    html

    <%@ CODEPAGE=65001 %>
    <% Response.Charset = "utf-8" %>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    
    <meta name="robots" content="index,follow,noodp" />
    
    <title>Hey</title>
    
    </head>
    
    <body class="body">
    
    <iframe width="800px" height="1024" src="http://www.dmg.eu/brugman/budgetplanner/aanmelden.php">
    </iframe>
    
    </body>
    
    </html>
    
    3 回复  |  直到 14 年前
        1
  •  1
  •   Peter Oehlert    14 年前

    在第一种情况下,我相信请求/响应的顺序如下,如果我错了,请纠正我。

    我们将调用brugman/budgetplanner/aanmelden.php和B/brugman/budgetplanner/。

    Request: POST A 
    Response: Redirect B (that's the 302)
    
    Request: GET B
    Response: Result of B
    

    Request: POST A
    Response: Redirect B (that's the 302)
    
    Request: GET B
    Response: Redirect Y (We see another 302)
    

    所发生的事情是,在第二种情况下,某些东西导致B也返回重定向头。问题不在客户机上,而在服务器上。

    • 您发布的4个fiddler标题的请求/响应主体是什么(请转到inspectors,顶部和底部窗格上的原始视图以获取此内容)。这将更清楚地显示我上面序列中X和Y的值。

    根据IE和FF比较第二个请求的主体,应该可以说明服务器对它们的不同看法(对于服务器来说,客户机只是准备请求的代理)。根据请求的不同,服务器会发回不同的响应。

        2
  •  10
  •   nathan kelly    14 年前

    此博客上的信息提供了要解决的完整详细信息和代码:

    http://viralpatel.net/blogs/2008/12/how-to-set-third-party-cookies-with-iframe.html

    如何在ASP.Net中设置p3p http头?

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

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

    如何在JSP中设置p3phttp头?

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

    如何在ColdFusion中设置p3phttp头?

    <cfheader name="P3P" value="CP='IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT'" />
    

        3
  •  1
  •   Younes    14 年前

    问题如下:

    未设置此会话,因为在IE中,当您要在iFrame中使用会话变量时,必须设置标头设置。

    ADD IN THIS LINE IN ORDER TO SOLVE THE INTERNET EXPLORER ALWAYS GET NEW SESSION ISSUE
    header('P3P: CP="CAO PSA OUR"');
    

    这是为了确保IE允许您使用会话。

    更多信息: http://www.w3.org/P3P/