0

Does the Rest Service Response use the Cookie header of the Request from Client ?

I am getting 2 Cookie headers from Request but those cookies are not being set to the Response.

How can I pass the same Cookies through Response and those 2 cookies need to be present in Client Browser ?

  • Cookie for a RESTful Service sounds really off because RESTful Services are meant to be Stateless. What is your requirement? – shazin Jul 14 '16 at 12:13
  • Look here: http://programmers.stackexchange.com/questions/141019/should-cookies-be-used-in-a-restful-api I think cookies are something against restful – francesco.s Jul 14 '16 at 12:14
  • @Shazin, I need to add **Set-Cookie** header to Response and it should be present in Client Browser. – dhanu routu Jul 14 '16 at 12:28
  • Create `NewCookie`s and set it in the `Response`. See [here](http://stackoverflow.com/q/34046292/2587435) and [here](http://docs.oracle.com/javaee/7/api/javax/ws/rs/core/NewCookie.html#NewCookie-javax.ws.rs.core.Cookie-) – Paul Samsotha Jul 14 '16 at 13:22

0 Answers0