| Constructor and Description |
|---|
DefaultCookie(String name,
String value)
Creates a new cookie with the specified name and value.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Cookie c) |
boolean |
equals(Object o) |
String |
getComment()
Returns the comment of this
Cookie. |
String |
getCommentUrl()
Returns the comment URL of this
Cookie. |
String |
getDomain()
Returns the domain of this
Cookie. |
long |
getMaxAge()
Returns the maximum age of this
Cookie in seconds or Long.MIN_VALUE if unspecified |
String |
getName()
Returns the name of this
Cookie. |
String |
getPath()
Returns the path of this
Cookie. |
Set<Integer> |
getPorts()
Returns the ports that this
Cookie can be accessed on. |
String |
getValue()
Returns the value of this
Cookie. |
int |
getVersion()
Returns the version of this
Cookie. |
int |
hashCode() |
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 |
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 |
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 |
toString() |
public String getName()
CookieCookie.public String getValue()
CookieCookie.public void setValue(String value)
CookieCookie.public String getDomain()
CookieCookie.public void setDomain(String domain)
CookieCookie.public String getPath()
CookieCookie.public void setPath(String path)
CookieCookie.public String getComment()
CookieCookie.getComment in interface CookieCookiepublic void setComment(String comment)
CookieCookie.setComment in interface Cookiecomment - The comment to usepublic String getCommentUrl()
CookieCookie.getCommentUrl in interface CookieCookiepublic void setCommentUrl(String commentUrl)
CookieCookie.setCommentUrl in interface CookiecommentUrl - The comment URL to usepublic boolean isDiscard()
CookieCookie is to be discarded by the browser
at the end of the current session.public void setDiscard(boolean discard)
CookieCookie.
If set to true, this Cookie will be discarded by the browser
at the end of the current sessionsetDiscard in interface Cookiediscard - True if the Cookie is to be discardedpublic Set<Integer> getPorts()
CookieCookie can be accessed on.public void setPorts(int... ports)
CookieCookie can be accessed on.public void setPorts(Iterable<Integer> ports)
CookieCookie can be accessed on.public long getMaxAge()
CookieCookie in seconds or Long.MIN_VALUE if unspecifiedpublic void setMaxAge(long maxAge)
CookieCookie 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.public int getVersion()
CookieCookie.getVersion in interface CookieCookiepublic void setVersion(int version)
CookieCookie.setVersion in interface Cookieversion - The new version to usepublic boolean isSecure()
CookieCookie is securepublic void setSecure(boolean secure)
CookieCookiepublic boolean isHttpOnly()
CookieCookie 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 hereisHttpOnly in interface CookieCookie is HTTP-only or false if it isn'tpublic void setHttpOnly(boolean httpOnly)
CookieCookie 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.setHttpOnly in interface CookiehttpOnly - True if the Cookie is HTTP only, otherwise false.public int compareTo(Cookie c)
compareTo in interface Comparable<Cookie>Copyright © 2008–2013 The Netty Project. All rights reserved.