我需要告诉Ajax.Request(从Prototype.js)设置xhr.transport.withCredentials为true(在我的跨站点请求标头中启用 cookie)。我尝试失败:
Ajax.Request('http://otherSubdomain.host:port/', {
onCreate: function(request){
request.transport.withCredentials = true;
}
});
Access-Control-Allow-Origin已设置且request成功,但未发送任何 cookie。
我不想指出,但使用jquery
here is an似乎要容易得多example solution。