I have a UI in AngularJS making calls to REST webservice in Java. Both are deployed on different domains. The webservice and AngularJS both have CORS enabled.
The webservice returns a cookie as part of one REST request. The cookie has the webservice domain in it.
In my AngularJS app, I will be making that REST request to the server and then have to read that cookie returned as response.
How can I read the cookie returned back from that webservice? I have read that I cannot access the cookies which are from different domain. I have not exactly understood how does this actually work.
Another question is that if I cannot read the cookie, then can I set cookie from AngularJS app for that domain and that will be sent across to the webservice?