java.lang.Object | |
↳ | org.springframework.web.util.CookieGenerator |
Known Direct Subclasses |
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, like CookieLocaleResolcer and CookieThemeResolver.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEFAULT_COOKIE_MAX_AGE | This constant is deprecated. in favor of setting no max age value at all in such a case | |||||||||
String | DEFAULT_COOKIE_PATH | Default path that cookies will be visible to: "/", i.e. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
logger |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add a cookie with the given value to the response,
using the cookie descriptor settings of this generator.
| |||||||||||
Return the domain for cookies created by this generator, if any.
| |||||||||||
Return the maximum age for cookies created by this generator.
| |||||||||||
Return the given name for cookies created by this generator.
| |||||||||||
Return the path for cookies created by this generator.
| |||||||||||
Return whether the cookie should only be sent using a secure protocol,
such as HTTPS (SSL).
| |||||||||||
Remove the cookie that this generator describes from the response.
| |||||||||||
Use the given domain for cookies created by this generator.
| |||||||||||
Use the given maximum age (in seconds) for cookies created by this generator.
| |||||||||||
Use the given name for cookies created by this generator.
| |||||||||||
Use the given path for cookies created by this generator.
| |||||||||||
Set whether the cookie should only be sent using a secure protocol,
such as HTTPS (SSL).
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a cookie with the given value, using the cookie descriptor
settings of this generator (except for "cookieMaxAge").
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
This constant is deprecated.
in favor of setting no max age value at all in such a case
Default maximum age of cookies: maximum integer value, i.e. forever.
Default path that cookies will be visible to: "/", i.e. the entire server.
Add a cookie with the given value to the response, using the cookie descriptor settings of this generator.
Delegates to createCookie(String)
for cookie creation.
response | the HTTP response to add the cookie to |
---|---|
cookieValue | the value of the cookie to add |
Return whether the cookie should only be sent using a secure protocol, such as HTTPS (SSL).
Remove the cookie that this generator describes from the response. Will generate a cookie with empty value and max age 0.
Delegates to createCookie(String)
for cookie creation.
response | the HTTP response to remove the cookie from |
---|
Use the given domain for cookies created by this generator. The cookie is only visible to servers in this domain.
Use the given maximum age (in seconds) for cookies created by this generator. Useful special value: -1 ... not persistent, deleted when client shuts down
Use the given name for cookies created by this generator.
Use the given path for cookies created by this generator. The cookie is only visible to URLs in this path and below.
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".
Create a cookie with the given value, using the cookie descriptor settings of this generator (except for "cookieMaxAge").
cookieValue | the value of the cookie to crate |
---|