Cookie is not set in browser

偶尔善良 提交于 2019-12-13 05:59:41

问题


I have been trying to connect the JAX-RS web service with AngularJS frontend. As you can see at the attached screenshots, the Chrome can read and parse the Set-Cookie value, but dismisses it for unknown reason.

JAX-RS snippet:

c1 = new NewCookie("session_id", uuid, "/", null, null, COOKIE_MAX_AGE, false);

return Response.status(200).cookie(c1).build();

Screenshots:


回答1:


Surprisingly, it was caused by the bad request. I did't set the " withCredentials: true" field in my AngularJS $http.post request.

https://stackoverflow.com/a/8530284/1349442



来源:https://stackoverflow.com/questions/31972753/cookie-is-not-set-in-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!