public class CookieManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LOG_KEY_ADDED_COOKIE |
static String |
LOG_KEY_DELETED_COOKIE |
Constructor and Description |
---|
CookieManager() |
Modifier and Type | Method and Description |
---|---|
void |
addCookie(String name,
String value,
javax.servlet.http.HttpServletResponse response)
Add a new cookie, using the configured domain, path and max age, to the response.
|
void |
deleteCookie(String name,
javax.servlet.http.HttpServletResponse response)
Add a "delete" cookie to the response to indicate the that the stored cookie should be deleted.
|
void |
setDomain(String domain) |
void |
setHttpOnly(boolean httpOnly) |
void |
setMaxAge(Integer maxAge) |
void |
setPath(String path) |
void |
setSecure(boolean secure) |
public static final String LOG_KEY_ADDED_COOKIE
public static final String LOG_KEY_DELETED_COOKIE
public void setDomain(String domain)
public void setPath(String path)
public void setMaxAge(Integer maxAge)
public void setHttpOnly(boolean httpOnly)
public void setSecure(boolean secure)
public void addCookie(String name, String value, javax.servlet.http.HttpServletResponse response)
name
- the name of the cookievalue
- the value of the cookiepublic void deleteCookie(String name, javax.servlet.http.HttpServletResponse response)
name
- the name of the cookieCopyright © 2023 CrafterCMS. All rights reserved.