Angularjs $http does not seem to understand “Set-Cookie” in the response

Make sure to configure your $http request to use credentials.
From the XHR documentation:

https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS

The most interesting capability exposed by both XMLHttpRequest and
Access Control is the ability to make “credentialed” requests that are
cognizant of HTTP Cookies and HTTP Authentication information. By
default, in cross-site XMLHttpRequest invocations, browsers will not
send credentials. A specific flag has to be set on the XMLHttpRequest
object when it is invoked.

You can use the options object to set the use of credentials, see

http://docs.angularjs.org/api/ng.$http

Example:

$http({withCredentials: true, ...}).get(...)

Leave a Comment