我正在通过域执行BrowserClient POST,但未看到包含我的Cookie。Dart BrowserClient POST不包含我的cookies
这我得到了响应:
当我发送另一个POST请求,我没有看到被列入饼干:
直去在测试页面中,我可以看到包含的曲奇:
达特代码,我用它来做一个POST:
var client = new BrowserClient();
client.post(url, body: request, headers:{"Content-Type" : "application/json", "Access-Control-Allow-Credentials":"true"}).then((res) {
if (res.statusCode == 200) {
var response = JSON.decode(res.body);
callback(response);
} else {
print(res.body);
print(res.reasonPhrase);
}
}).whenComplete(() {
client.close();
});
不知道的访问控制允许的凭据头,我,包括有或没有它,没有什么变化。
我是否在服务器端丢失了需要在响应中设置的标题,或者Dartium是否阻止了跨域Cookie?
有关Information Security的更多详细信息以及通过服务器设置Cookie的原因。
更新:改进请求记录:https://code.google.com/p/dart/issues/detail?id=23088
更新:强化执行,应该现在是基于 https://github.com/dart-lang/http/commit/9d76e5e3c08e526b12d545517860c092e089a313
我想你需要在你的发布请求中设置'withCredentials = true',但是我还没有发现如何用http包的请求来做到这一点(就像在http://stackoverflow.com/questions/中一样21770445或http://stackoverflow.com/questions/16939328)。 – 2015-04-03 06:51:37
我可以看到在angular.dart中做了特别的规定,但在浏览器客户端中没有这样做https://github.com/dsalsbury/angular.dart/commit/9ff1bc321cd201bee09f8420c42e61632481ffb7 – 2015-04-03 07:01:14
如果angular.dart正在这样做,肯定它必须调用引擎盖下的标准dart库还是angular.dart都有自己的BrowserClient类库? – 2015-04-03 07:29:39