We are working on a RESTful Webservice with AngularJS and Java Servlets.
When the user logs in, our backend sends a "Set-Cookie" header to the frontend. In Angular we access the header via $cookies
(ngCookie - module) and set it.
Now that the user is logged in he can for example delete some stuff. Therefore the frontend sends a GET request to the backend. Because we work on different domains we need to set some CORS Headers and Angular does an OPTIONS request before the actual GET request:
OPTIONS request:
GET request
We do this in Angular via $http module, but it just won't send the cookie, containing JSESSIONID
.
How can I enable Angular to send cookies?