我无法从请求中删除一些 cookie (2),我不知道为什么...
我试过这种方法:
将过期时间设置为 0,将值设置为空白,将安全标志设置为 false
@GET
@Path("clear-cookies")
public Response clear-cookies(@QueryParam(NEXT) String next) throws Exception {
Viewable page = getPage();
// Returns form and remove cookies, setting expiration time to zero.
return javax.ws.rs.core.Response
.ok(page)
.cookie(new NewCookie(NEXT, next))
.cookie(new NewCookie(FIRST, "", null, null, null, 0, false))
.cookie(new NewCookie(SECOND, "", null, null, null, 0, false))
.build();
}
将过期时间设置为 0,将值设置为 null,将安全标志设置为 true
@GET
@Path("clear-cookies")
public Response clear-cookies(@QueryParam(NEXT) String next) throws Exception {
Viewable page = getPage();
// Returns form and remove cookies, setting expiration time to zero.
return javax.ws.rs.core.Response
.ok(page)
.cookie(new NewCookie(NEXT, next))
.cookie(new NewCookie(FIRST, null, null, null, null, 0, true))
.cookie(new NewCookie(SECOND, null, null, null, null, 0, true))
.build();
}