Package org.craftercms.commons.http
Class CookieManager
java.lang.Object
org.craftercms.commons.http.CookieManager
Utility class to create and delete cookies with common domain, path and max age.
- Author:
- avasquez
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
void
setHttpOnly
(boolean httpOnly) void
void
void
setSecure
(boolean secure)
-
Field Details
-
LOG_KEY_ADDED_COOKIE
- See Also:
-
LOG_KEY_DELETED_COOKIE
- See Also:
-
-
Constructor Details
-
CookieManager
public CookieManager()
-
-
Method Details
-
setDomain
-
setPath
-
setMaxAge
-
setHttpOnly
public void setHttpOnly(boolean httpOnly) -
setSecure
public void setSecure(boolean secure) -
addCookie
Add a new cookie, using the configured domain, path and max age, to the response.- Parameters:
name
- the name of the cookievalue
- the value of the cookie
-
deleteCookie
Add a "delete" cookie to the response to indicate the that the stored cookie should be deleted.- Parameters:
name
- the name of the cookie
-