2010-07-14 61 views
2

我遇到了一些关于框架和Internet Explorer的非常奇怪的怪诞故事。框架+ Internet Explorer怪异

的情况是这样的:

  • 我有我的web应用程序www.webapp.com
  • 我有希望有一个登录框我www.webapp.com上的客户端了网站:www.vendor.com
  • 供应商他的网站是由他的webdesigner设置在www.vendor.com。它由2帧组成:
    • 第一帧跨越100%的高度和宽度和它的位置是在www.webdedesigner.com/clients/vendor
    • 第二帧跨越0,0和不指向任何

远程站点上的登录框指向我的Web应用程序。帖子登录名+用户名等 客户端的网站设置与框架的原因是,浏览器的URL地址栏始终保存在www.vendor.com。 (呃,甚至不让我开始)。

问题是,当我从www.vendor.com登录到我的web应用程序,并且我的web应用程序被加载到框架中时,我的所有CSS和Javascript都未加载。

这只发生在IE7/8中,我已经在Firefox,Chrome,Opera和Safari中测试过了,它们中的每一个都会加载我的CSS和JS文件。

这是我的头看起来像:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="nl" xmlns:xf="http://www.w3.org/2002/xforms"> 
    <head> 
    <title>My Webapp</title> 
    <meta http-equiv="Content-Type" content="text/html" /> 
    <link rel="icon" href="/img/favicon.ico" /> 
    <link rel="shortcut icon" href="/img/favicon.ico" /> 
    <link rel="stylesheet" type="text/css" href="/css/css.php?css=public" /> 
    <script type="text/javascript" src="/js/js.php?js=public"></script> 
    </head> 
    <body> 

我怀疑IE不处理CSS/JS正确的relatie URL的...

还有一个更奇怪的事情!如果我清除了我的IE浏览缓存,并且我首先通过该域登录到www.webapp.com,并且通过IE中的www.vendor.com登出并登录,CSS/JS将加载!什么......?我的整个web应用程序驻留在HTTPS,所以它不应该缓存任何资源...

我flamberasted所以我诉诸张贴在这里..任何人都知道这是怎么回事?

编辑

好吧,以后我安装了Internet Explorer的一个适当的调试工具(而不是默认的一个),我是能够检查beeing发送的HTTP标头。所以,我比较了IE和Firefox和这些结果出现了:

IE请登录后到我的webapp

(Request-Line):POST /?portal&returnurl=www.vendor.com HTTP/1.1 
Accept:application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* 
Content-Type:application/x-www-form-urlencoded 
Accept-Encoding:gzip, deflate 
Host:www.webapp.nl 
Content-Length:40 
Connection:Keep-Alive 
Cache-Control:no-cache 

IE响应

(Status-Line):HTTP/1.1 200 OK 
Date:Wed, 14 Jul 2010 10:35:34 GMT 
Server:Apache 
X-Powered-By:PHP/5.1.6 
**Set-Cookie:PHPSESSID=uiluornfipr2dk294iro09tgg6; path=/** 
Expires:Thu, 19 Nov 1981 08:52:00 GMT 
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 
Pragma:no-cache 
Set-Cookie:lang=0 
Set-Cookie:lang=0 
Connection:close 
Transfer-Encoding:chunked 
Content-Type:text/html; charset=UTF-8 

IE CSS请求:

(Request-Line):GET /css/css.php?css=portal HTTP/1.1 
Accept:*/* 
Host:www.webapp.nl 
Connection:Keep-Alive 

IE CSS响应

(Status-Line):HTTP/1.1 200 OK 
Date:Wed, 14 Jul 2010 10:35:35 GMT 
Server:Apache 
X-Powered-By:PHP/5.1.6 
**Set-Cookie:PHPSESSID=pe2cio1vhu0shq2i497bjh5oa4; path=/** 
Expires:Thu, 19 Nov 1981 08:52:00 GMT 
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 
Pragma:no-cache 
Content-Length:0 
Connection:close 
Content-Type:text/html; charset=UTF-8 

火狐请求登录后到我的webapp

Host www.webapp.nl 
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 
Accept-Language nl,en-us;q=0.7,en;q=0.3 
Accept-Encoding gzip,deflate 
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 
Keep-Alive 115 
Connection keep-alive 

FF响应

Date Wed, 14 Jul 2010 10:38:57 GMT 
Server Apache 
X-Powered-By PHP/5.1.6 
**Set-Cookie PHPSESSID=re10rmqq7u723ht3719o9q5el3; path=/ lang=0 lang=0** 
Expires Thu, 19 Nov 1981 08:52:00 GMT 
Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0 
Pragma no-cache 
Connection close 
Transfer-Encoding chunked 
Content-Type text/html; charset=UTF-8 

FFÇ SS要求

Host www.webapp.nl 
Accept text/css,*/*;q=0.1 
Accept-Language nl,en-us;q=0.7,en;q=0.3 
Accept-Encoding gzip,deflate 
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 
Keep-Alive 115 
Connection keep-alive 
**Cookie PHPSESSID=re10rmqq7u723ht3719o9q5el3; lang=0** 

FF CSS响应

Date Wed, 14 Jul 2010 10:38:57 GMT 
Server Apache 
X-Powered-By PHP/5.1.6 
Expires Thu, 19 Nov 1981 08:52:00 GMT 
Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0 
Pragma no-cache 
Connection close 
Transfer-Encoding chunked 
Content-Type text/css; charset=utf-8 

(去掉了一些为简洁起见)

差别是显而易见的。 IE不会将cookie与CSS请求一起发送,即使它确实从登录响应接收到set-cookie。 Firefox确实发送了cookie以及CSS请求。 除非设置了有效的cookie,否则我的webapp不会返回CSS/Script。

Soo,任何框架/ cookie专家都知道为什么IE不会沿着它在第一个响应中收到的cookies发送它正在加载的页面的更多资源请求?

块引用

回答

2

默认情况下,IE阻止来自第三方网站的Cookie,您应该在状态栏中注意到隐私问题变得活跃,并声明它已阻止您网站上的Cookie。

+0

嗯,这似乎是这样,我登录后,隐私眼睛确实出现。 --- 虽然我不明白。无论浏览器的位置栏是直接显示www.webapp.com还是通过框架显示www.webapp.com,cookie的设置都应在www.webapp.com域名前完成。 --- 我知道我不允许为www.vendor.com域设置cookie,但为什么IE会认为我想要这样做呢? (所有其他浏览器不,他们明白我为www.webapp.com域设置cookie)? – Kwaak 2010-07-14 11:39:39

+0

IE知道您要为您的webapp.com域设置cookie,但该页面是vendor.com中的框架。由于这些域不同,IE的默认配置是通过webapp阻止请求。com域来设置任何cookie。 IIRC您可以在设置cookie时使用一些P3P标头解决此问题。 – AlfonsoML 2010-07-14 13:27:38

0

是不是?JS =公众被截断?