How can I put a cookie in Jersey RESTful webservice?

懵懂的女人 提交于 2019-12-06 07:11:05
Martin Matula

The server sets the cookie only once (i.e. only the first response has Set-Cookie header). Once the client gets the cookie, it should attach it to it's requests, but the server no longer sends the cookie in the responses. That's normal behavior. So not sure what problem you are trying to solve.

Here is how you can write a Jersey filter that will make sure it adds the cookies set by the server to every request: Jersey Client: Adding Cookies to Request

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