| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| public static final int | DEFAULT_MAX_AGE
Specifies that the cookie expires with the current application/browser session. |
| private static final RuntimeDelegate. | |
| private final Date | |
| private final boolean | |
| private final int | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | NewCookie(String
the name of the cookie. name, String the value of the cookie. value, String the URI path for which the cookie is valid. path, String the host domain for which the cookie is valid. domain, String the comment. comment, int the maximum age of the cookie in seconds. maxAge, boolean specifies whether the cookie will only be sent over a secure connection. secure)Create a new instance. |
| public | NewCookie(String
the name of the cookie. name, String the value of the cookie. value, String the URI path for which the cookie is valid. path, String the host domain for which the cookie is valid. domain, String the comment. comment, int the maximum age of the cookie in seconds. maxAge, boolean specifies whether the cookie will only be sent over a secure connection. secure, boolean if httpOnly)true make the cookie HTTP only, i.e. only visible as part of an HTTP request.Create a new instance. |
| public | NewCookie(String
the name of the cookie name, String the value of the cookie value, String the URI path for which the cookie is valid path, String the host domain for which the cookie is valid domain, int the version of the specification to which the cookie complies version, String the comment comment, int the maximum age of the cookie in seconds maxAge, boolean specifies whether the cookie will only be sent over a secure connection secure)Create a new instance. |
| public | NewCookie(String
the name of the cookie name, String the value of the cookie value, String the URI path for which the cookie is valid path, String the host domain for which the cookie is valid domain, int the version of the specification to which the cookie complies version, String the comment comment, int the maximum age of the cookie in seconds maxAge, Date the cookie expiry date. expiry, boolean specifies whether the cookie will only be sent over a secure connection secure, boolean if httpOnly)true make the cookie HTTP only, i.e. only visible as part of an HTTP request.Create a new instance. |
| public | |
| public | |
| public | NewCookie(Cookie
the cookie to clone. cookie, String the comment. comment, int the maximum age of the cookie in seconds. maxAge, Date the cookie expiry date. expiry, boolean specifies whether the cookie will only be sent over a secure connection. secure, boolean if httpOnly)true make the cookie HTTP only, i.e. only visible as part of an HTTP request.Create a new instance supplementing the information in the supplied cookie. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the object is aNewCookie with the same value for
all properties, false otherwise.the object to compare to obj)Overrides javax. |
| public String | |
| public Date | Returns: cookie expiry date ornull if no expiry date was set.Get the cookie expiry date. |
| public int | |
| public int | Returns: the hash code.Overrides javax. |
| public boolean | Returns: true if this cookie should be considered http only, false
otherwise.Returns |
| public boolean | Returns: true if the cookie will only be sent over a secure connection,
false otherwise.Whether the cookie will only be sent over a secure connection. |
| public Cookie | |
| public String | Returns: a stringified cookie.Overrides javax. |
| public static NewCookie |
| comment | back to summary |
|---|---|
| private final String comment | |
| DEFAULT_MAX_AGE | back to summary |
|---|---|
| public static final int DEFAULT_MAX_AGE Specifies that the cookie expires with the current application/browser session. | |
| delegate | back to summary |
|---|---|
| private static final RuntimeDelegate. | |
| expiry | back to summary |
|---|---|
| private final Date expiry | |
| httpOnly | back to summary |
|---|---|
| private final boolean httpOnly | |
| maxAge | back to summary |
|---|---|
| private final int maxAge | |
| secure | back to summary |
|---|---|
| private final boolean secure | |
| NewCookie | back to summary |
|---|---|
| public NewCookie(String name, String value) Create a new instance.
| |
| NewCookie | back to summary |
|---|---|
| public NewCookie(String name, String value, String path, String domain, String comment, int maxAge, boolean secure) Create a new instance.
| |
| NewCookie | back to summary |
|---|---|
| public NewCookie(String name, String value, String path, String domain, String comment, int maxAge, boolean secure, boolean httpOnly) Create a new instance.
| |
| NewCookie | back to summary |
|---|---|
| public NewCookie(String name, String value, String path, String domain, int version, String comment, int maxAge, boolean secure) Create a new instance.
| |
| NewCookie | back to summary |
|---|---|
| public NewCookie(String name, String value, String path, String domain, int version, String comment, int maxAge, Date expiry, boolean secure, boolean httpOnly) Create a new instance.
| |
| NewCookie | back to summary |
|---|---|
| public NewCookie(Cookie cookie) Create a new instance copying the information in the supplied cookie.
| |
| NewCookie | back to summary |
|---|---|
| public NewCookie(Cookie cookie, String comment, int maxAge, boolean secure) Create a new instance supplementing the information in the supplied cookie.
| |
| NewCookie | back to summary |
|---|---|
| public NewCookie(Cookie cookie, String comment, int maxAge, Date expiry, boolean secure, boolean httpOnly) Create a new instance supplementing the information in the supplied cookie.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides javax. Compare for equality. Use
| |
| getComment | back to summary |
|---|---|
| public String getComment() Get the comment associated with the cookie.
| |
| getExpiry | back to summary |
|---|---|
| public Date getExpiry() Get the cookie expiry date. Cookies whose expiry date has passed are discarded. A cookie can be unset by setting a new cookie with an expiry date in the past, typically the lowest possible date that can be set.
Note that it is recommended to use
| |
| getMaxAge | back to summary |
|---|---|
| public int getMaxAge() Get the maximum age of the the cookie in seconds. Cookies older than
the maximum age are discarded. A cookie can be unset by sending a new
cookie with maximum age of 0 since it will overwrite any existing cookie
and then be immediately discarded. The default value of
Note that it is recommended to use
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides javax. Generate a hash code by hashing all of the properties.
| |
| isHttpOnly | back to summary |
|---|---|
| public boolean isHttpOnly() Returns
| |
| isSecure | back to summary |
|---|---|
| public boolean isSecure() Whether the cookie will only be sent over a secure connection. Defaults
to
| |
| toCookie | back to summary |
|---|---|
| public Cookie toCookie() Obtain a new instance of a | |
| toString | back to summary |
|---|---|
| public String toString() Overrides javax. Convert the cookie to a string suitable for use as the value of the corresponding HTTP header. | |
| valueOf | back to summary |
|---|---|
| public static NewCookie valueOf(String value) Hides javax. Creates a new instance of NewCookie by parsing the supplied string.
| |