I am doing POST BrowserClient across domains and cannot see my cookies being enabled.
This is the answer I get:

When I send another POST request, I don’t see cookies being enabled:

Going directly to the test page, I see that cookies are enabled:


The Dart code that I use to create the POST is:
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(); });
I'm not sure about the Access-Control-Allow-Credentials header, which I include in, with or without it, nothing changes.
Am I skipping server-side headers that should be configured to respond, or is Dartium blocking files with multiple domains?
Learn more about information security and how to set a cookie using a server.
Update: registered request for improvement: https://code.google.com/p/dart/issues/detail?id=23088
Update: the improvement has been completed, now you can do var client = new BrowserClient()..withCredentials=true; based on https://github.com/dart-lang/http/commit/9d76e5e3c08e526b12d545517860c092e089a313
cookies cors dart dartium
Jan Vladimir Mostert Apr 03 2018-11-15T00: 00Z
source share