@Override public Cookie removeCookie(String name, boolean invalidate) { Cookie cookie = cookiesMap().get(name); if (cookie != null) { if (invalidate && cookie.isFromUserAgent()) { // in the case the cookie was passed from the User Agent // we need to expire it and sent it back to it can be // invalidated cookie.setMaxAge(0L); } else { // this was a temporary cookie so we can safely remove it cookiesMap().remove(name); } } return cookie; }
/** * Has this Cookie been sent from the User Agent (the browser)? or was created during the executing on the request. * @return true if the cookie comes from the User Agent. */ public boolean isFromUserAgent() { boolean ret = delegate.isFromUserAgent(); return ret; }
/** * Has this Cookie been sent from the User Agent (the browser)? or was created during the executing on the request. * @return true if the cookie comes from the User Agent. */ public boolean isFromUserAgent() { boolean ret = delegate.isFromUserAgent(); return ret; }
@Override public Cookie removeCookie(String name, boolean invalidate) { Cookie cookie = cookiesMap().get(name); if (cookie != null) { if (invalidate && cookie.isFromUserAgent()) { // in the case the cookie was passed from the User Agent // we need to expire it and sent it back to it can be // invalidated cookie.setMaxAge(0L); } else { // this was a temporary cookie so we can safely remove it cookiesMap().remove(name); } } return cookie; }