Package org.springframework.web.util
Class CookieGenerator
java.lang.Object
org.springframework.web.util.CookieGenerator
- Direct Known Subclasses:
- CookieThemeResolver
Deprecated.
Helper class for cookie generation, carrying cookie descriptor settings
 as bean properties and being able to add and remove cookie to/from a
 given response.
 
Can serve as base class for components that generate specific cookies.
- Since:
- 1.1.4
- Author:
- Juergen Hoeller
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddCookie(HttpServletResponse response, String cookieValue) Deprecated.Add a cookie with the given value to the response, using the cookie descriptor settings of this generator.protected CookiecreateCookie(String cookieValue) Deprecated.Create a cookie with the given value, using the cookie descriptor settings of this generator (except for "cookieMaxAge").Deprecated.Return the domain for cookies created by this generator, if any.Deprecated.Return the maximum age for cookies created by this generator.Deprecated.Return the given name for cookies created by this generator.Deprecated.Return the path for cookies created by this generator.booleanDeprecated.Return whether the cookie is supposed to be marked with the "HttpOnly" attribute.booleanDeprecated.Return whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL).voidremoveCookie(HttpServletResponse response) Deprecated.Remove the cookie that this generator describes from the response.voidsetCookieDomain(String cookieDomain) Deprecated.Use the given domain for cookies created by this generator.voidsetCookieHttpOnly(boolean cookieHttpOnly) Deprecated.Set whether the cookie is supposed to be marked with the "HttpOnly" attribute.voidsetCookieMaxAge(Integer cookieMaxAge) Deprecated.Use the given maximum age (in seconds) for cookies created by this generator.voidsetCookieName(String cookieName) Deprecated.Use the given name for cookies created by this generator.voidsetCookiePath(String cookiePath) Deprecated.Use the given path for cookies created by this generator.voidsetCookieSecure(boolean cookieSecure) Deprecated.Set whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL).
- 
Field Details- 
DEFAULT_COOKIE_PATHDeprecated.Default path that cookies will be visible to: "/", i.e. the entire server.- See Also:
 
- 
loggerDeprecated.
 
- 
- 
Constructor Details- 
CookieGeneratorpublic CookieGenerator()Deprecated.
 
- 
- 
Method Details- 
setCookieNameDeprecated.Use the given name for cookies created by this generator.- See Also:
 
- 
getCookieNameDeprecated.Return the given name for cookies created by this generator.
- 
setCookieDomainDeprecated.Use the given domain for cookies created by this generator. The cookie is only visible to servers in this domain.- See Also:
 
- 
getCookieDomainDeprecated.Return the domain for cookies created by this generator, if any.
- 
setCookiePathDeprecated.Use the given path for cookies created by this generator. The cookie is only visible to URLs in this path and below.- See Also:
 
- 
getCookiePathDeprecated.Return the path for cookies created by this generator.
- 
setCookieMaxAgeDeprecated.Use the given maximum age (in seconds) for cookies created by this generator. Useful special value: -1 ... not persistent, deleted when client shuts down.Default is no specific maximum age at all, using the Servlet container's default. - See Also:
 
- 
getCookieMaxAgeDeprecated.Return the maximum age for cookies created by this generator.
- 
setCookieSecurepublic void setCookieSecure(boolean cookieSecure) Deprecated.Set whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL). This is an indication to the receiving browser, not processed by the HTTP server itself.Default is "false". - See Also:
 
- 
isCookieSecurepublic boolean isCookieSecure()Deprecated.Return whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL).
- 
setCookieHttpOnlypublic void setCookieHttpOnly(boolean cookieHttpOnly) Deprecated.Set whether the cookie is supposed to be marked with the "HttpOnly" attribute.Default is "false". - See Also:
 
- 
isCookieHttpOnlypublic boolean isCookieHttpOnly()Deprecated.Return whether the cookie is supposed to be marked with the "HttpOnly" attribute.
- 
addCookieDeprecated.Add a cookie with the given value to the response, using the cookie descriptor settings of this generator.Delegates to createCookie(java.lang.String)for cookie creation.- Parameters:
- response- the HTTP response to add the cookie to
- cookieValue- the value of the cookie to add
- See Also:
 
- 
removeCookieDeprecated.Remove the cookie that this generator describes from the response. Will generate a cookie with empty value and max age 0.Delegates to createCookie(java.lang.String)for cookie creation.- Parameters:
- response- the HTTP response to remove the cookie from
- See Also:
 
- 
createCookieDeprecated.Create a cookie with the given value, using the cookie descriptor settings of this generator (except for "cookieMaxAge").- Parameters:
- cookieValue- the value of the cookie to crate
- Returns:
- the cookie
- See Also:
 
 
- 
ResponseCookie