I want to delete a cookie on the server (using a Expirespast install ). How can I do this using javax.ws.rs.core.NewCookie? I am trying to do this, but this does not work:
return Response.ok()
.entity("hello world!")
.cookie(
new NewCookie(
"foo",
"",
"/",
".example.com",
1,
"no comment",
0,
false
)
)
.build();
This snippet creates this HTTP header:
Set-Cookie:foo=;Version=1;Comment="no comment";Domain=.example.com;Path=/
This header does not remove the cookie from the server. What is the possible workaround?
source
share