标签: java servlets session-cookies
{ final Cookie cookies = new Cookie(key, value); cookies.setMaxAge(-1); response.addCookie(cookies); }
设置MaxAge = -1将在浏览器关闭时清除cookie。但我希望在关闭标签时清除cookie。
MaxAge = -1