I am faced with a scenario where my UI in AngularJS is interacting with a REST webservice in Java, both of which are deployed on different domains. CORS has been enabled for both the webservice and AngularJS.
During one of the REST requests, the webservice returns a cookie that contains the domain of the webservice.
My challenge is to read this cookie in my AngularJS application after making the REST request to the server.
I have come across information suggesting that accessing cookies from a different domain is not allowed, but I'm unsure of how this restriction actually functions.
Furthermore, if reading the cookie is not feasible, can I set a cookie from the AngularJS app for that specific domain, ensuring that it gets sent to the webservice?