public interface Cookie
Modifiers | Name | Description |
---|---|---|
static long |
DURATION_ONE_DAY |
|
static long |
DURATION_ONE_HOUR |
|
static long |
DURATION_ONE_MONTH |
|
static long |
DURATION_ONE_YEAR |
Type Params | Return Type | Name and description |
---|---|---|
|
public static Cookie |
create(java.lang.String name, java.lang.String value) Create a cookie with a default max age of one month. |
|
public java.lang.String |
getDomain() |
|
public long |
getMaxAge() |
|
public java.lang.String |
getName() |
|
public java.lang.String |
getPath() |
|
public java.lang.String |
getValue() |
|
public Cookie |
setDomain(java.lang.String domain)
|
|
public Cookie |
setMaxAge(long maxAge) Sets how long the cookie should persist. |
|
public Cookie |
setPath(java.lang.String path)
|
Create a cookie with a default max age of one month.
name
- The name of the cookie.value
- The cookie's value.
domain
- The domain for this cookieSets how long the cookie should persist. Useful values can be found in the Cookie.DURATION_* static fields of this class.
maxAge
- The maximum age of the cookie. Defaults to Cookie.DURATION_ONE_MONTH.
path
- The server path this cookie applies to.