I am using jersey jax-rs in myeclipse as backend of my project and jsp as frontend. I want to set cookie from server after successful login. In the jersey\'s official docume
To set the cookie in your example, you can do something like this:
return Response.ok(new Viewable("/index", model))
.cookie(new NewCookie("name", "Hello, world!"))
.build();
But if you want to redirect to "/" you would also need to return 3xx response instead of 200, for example:
return Response.seeOther("/")
.cookie(new NewCookie("name", "Hello, world!"))
.build();