I am building a website using Angular 5 as frontend, and JAX-RS with Jersey as backend. The website requires the user to login using their email and password, which is sent to the API with POST. I then want the client to receive a cookie, but this is where I'm having trouble. The API sends a response with a cookie (I can see the cookie when I test it in Postman), but in Google Chrome it looks like no cookie is received, and no header is named 'Set-Cookie'.
My method that sends the cookie from the backend:
@GET
@Path("cookie")
public Response getCookies(){
NewCookie cookie1 = new NewCookie("cookie1", "test");
return Response.ok().cookie(cookie1)
.build();
}
I'm using a CORS-filter where I set AllowCredentials to true. What have I missed?