public interface Cookie extends Comparable<Cookie>
| Modifier and Type | Method and Description |
|---|---|
String |
comment()
Returns the comment of this
Cookie. |
String |
commentUrl()
Returns the comment URL of this
Cookie. |
String |
domain()
Returns the domain of this
Cookie. |
String |
getComment()
Deprecated.
Use
comment() instead. |
String |
getCommentUrl()
Deprecated.
Use
commentUrl() instead. |
String |
getDomain()
Deprecated.
Use
domain() instead. |
long |
getMaxAge()
Deprecated.
Use
maxAge() instead. |
String |
getName()
Deprecated.
Use
name() instead. |
String |
getPath()
Deprecated.
Use
path() instead. |
Set<Integer> |
getPorts()
Deprecated.
Use
ports() instead. |
String |
getValue()
Deprecated.
Use
value() instead. |
int |
getVersion()
Deprecated.
Use
version() instead. |
boolean |
isDiscard()
Checks to see if this
Cookie is to be discarded by the browser
at the end of the current session. |
boolean |
isHttpOnly()
Checks to see if this
Cookie can only be accessed via HTTP. |
boolean |
isSecure()
Checks to see if this
Cookie is secure |
long |
maxAge()
Returns the maximum age of this
Cookie in seconds or Long.MIN_VALUE if unspecified |
String |
name()
Returns the name of this
Cookie. |
String |
path()
Returns the path of this
Cookie. |
Set<Integer> |
ports()
Returns the ports that this
Cookie can be accessed on. |
String |
rawValue()
Returns the raw value of this
Cookie,
as it was set in original Set-Cookie header. |
void |
setComment(String comment)
Sets the comment of this
Cookie. |
void |
setCommentUrl(String commentUrl)
Sets the comment URL of this
Cookie. |
void |
setDiscard(boolean discard)
Sets the discard flag of this
Cookie. |
void |
setDomain(String domain)
Sets the domain of this
Cookie. |
void |
setHttpOnly(boolean httpOnly)
Determines if this
Cookie is HTTP only. |
void |
setMaxAge(long maxAge)
Sets the maximum age of this
Cookie in seconds. |
void |
setPath(String path)
Sets the path of this
Cookie. |
void |
setPorts(int... ports)
Sets the ports that this
Cookie can be accessed on. |
void |
setPorts(Iterable<Integer> ports)
Sets the ports that this
Cookie can be accessed on. |
void |
setRawValue(String rawValue)
Sets the raw value of this
Cookie. |
void |
setSecure(boolean secure)
Sets the security getStatus of this
Cookie |
void |
setValue(String value)
Sets the value of this
Cookie. |
void |
setVersion(int version)
Sets the version of this
Cookie. |
String |
value()
Returns the value of this
Cookie. |
int |
version()
Returns the version of this
Cookie. |
compareTo@Deprecated String getName()
name() instead.@Deprecated String getValue()
value() instead.void setValue(String value)
Cookie.value - The value to setString rawValue()
Cookie,
as it was set in original Set-Cookie header.Cookievoid setRawValue(String rawValue)
Cookie.rawValue - The raw value to set@Deprecated String getDomain()
domain() instead.void setDomain(String domain)
Cookie.domain - The domain to use@Deprecated String getPath()
path() instead.void setPath(String path)
Cookie.path - The path to use for this Cookie@Deprecated String getComment()
comment() instead.void setComment(String comment)
Cookie.comment - The comment to use@Deprecated long getMaxAge()
maxAge() instead.long maxAge()
Cookie in seconds or Long.MIN_VALUE if unspecifiedCookievoid setMaxAge(long maxAge)
Cookie in seconds.
If an age of 0 is specified, this Cookie will be
automatically removed by browser because it will expire immediately.
If Long.MIN_VALUE is specified, this Cookie will be removed when the
browser is closed.maxAge - The maximum age of this Cookie in seconds@Deprecated int getVersion()
version() instead.void setVersion(int version)
Cookie.version - The new version to useboolean isSecure()
Cookie is secureCookie is secure, otherwise falsevoid setSecure(boolean secure)
Cookiesecure - True if this Cookie is to be secure, otherwise falseboolean isHttpOnly()
Cookie can only be accessed via HTTP.
If this returns true, the Cookie cannot be accessed through
client side script - But only if the browser supports it.
For more information, please look hereCookie is HTTP-only or false if it isn'tvoid setHttpOnly(boolean httpOnly)
Cookie is HTTP only.
If set to true, this Cookie cannot be accessed by a client
side script. However, this works only if the browser supports it.
For for information, please look
here.httpOnly - True if the Cookie is HTTP only, otherwise false.@Deprecated String getCommentUrl()
commentUrl() instead.String commentUrl()
Cookie.Cookievoid setCommentUrl(String commentUrl)
Cookie.commentUrl - The comment URL to useboolean isDiscard()
Cookie is to be discarded by the browser
at the end of the current session.Cookie is to be discarded, otherwise falsevoid setDiscard(boolean discard)
Cookie.
If set to true, this Cookie will be discarded by the browser
at the end of the current sessiondiscard - True if the Cookie is to be discarded@Deprecated Set<Integer> getPorts()
ports() instead.void setPorts(int... ports)
Cookie can be accessed on.ports - The ports that this Cookie can be accessed onCopyright © 2008–2015 The Netty Project. All rights reserved.