在带有Cookie的IE9中提出CORS请求? [英] Make a CORS request in IE9 with cookies?

查看:73
本文介绍了在带有Cookie的IE9中提出CORS请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IE9中,我尝试使用Cookie进行跨源请求。但是,即使我有Access-Control-Allow-Origin,Access-Control-Allow-Credentials,Access-Control-Allow-Methods都设置为适当的值(原始域,true和GET,POST),IE9仍然没有从请求发送或设置Cookie。这是我正在使用的脚本:

In IE9, I am attempting to make a cross origin request with cookies. However, even when I have the Access-Control-Allow-Origin, Access-Control-Allow-Credentials, Access-Control-Allow-Methods all set to the appropriate values (the origin domain, true, and GET, POST), IE9 still isn't sending or setting cookies from the request. Here's the script I'm using:

var xdr = new XDomainRequest()
xdr.open("http://mydomain.com/cors.php")
xdr.withCredentials = true;
xdr.send();

关于如何在IE9中使用cookie来处理CORS请求的任何想法?

Any idea on how to get cookies to work with CORS requests in IE9?

推荐答案

从此页面 http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx 在底部,您可以看到更新:Internet Explorer 10现在使用XMLHTTPRequest支持CORS。这意味着在IE9中不能正确处理CORS。抱歉。他们在同一篇文章中提出了一些有关代理的解决方法。

From this page http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx at the bottom you can see Update: Internet Explorer 10 now supports CORS using XMLHTTPRequest. It means CORS is not handled properly in IE9. Sorry. They propose some workarounds with proxy in the same article.

浏览器兼容性列表在 http: //caniuse.com/cors 其中表示部分支持的意思是

Browser compatibility matrix is given at http://caniuse.com/cors where by partial support they mean


Internet Explorer 8通过XDomainRequest对象提供了支持,但没有不支持凭据请求 http://code.google.com/p/sgvizler/wiki/Compatibility

这篇关于在带有Cookie的IE9中提出CORS请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆