HTTP "magic-cookie" represents a piece of state information that the HTTP agent and the target server can exchange to maintain a session.
| Constructor Summary |
|---|
|
Default constructor. |
|
Creates a cookie with the given name, value and domain attribute. |
|
Creates a cookie with the given name, value, domain attribute, path attribute, expiration attribute, and secure attribute |
|
Creates a cookie with the given name, value, domain attribute, path attribute, maximum age attribute, and secure attribute |
| Method Summary | |
|---|---|
| int |
Compares two cookies to determine order for cookie header. |
| boolean |
Two cookies are equal if the name, path and domain match. |
| String |
Returns the comment describing the purpose of this cookie, or null if no such comment has been defined. |
| String |
Returns domain attribute of the cookie. |
| Date |
Returns the expiration Date of the cookie, or null if none exists. |
| String |
Returns the path attribute of the cookie |
| boolean |
No description provided. |
| int |
Returns the version of the cookie specification to which this cookie conforms. |
| int |
Returns a hash code in keeping with the hashCode() general hashCode contract. |
| boolean |
Returns true if cookie's domain was set via a domain attribute in the Set-Cookie header. |
| boolean |
Returns true if this cookie has expired. |
| boolean |
Returns true if this cookie has expired according to the time passed in. |
| boolean |
Returns true if cookie's path was set via a path attribute in the Set-Cookie header. |
| boolean |
Returns false if the cookie should be discarded at the end of the "session"; true otherwise. |
| void |
If a user agent (web browser) presents this cookie to a user, the cookie's purpose will be described using this comment. |
| void |
Sets the domain attribute. |
| void |
Indicates whether the cookie had a domain specified in a domain attribute of the Set-Cookie header. |
| void |
Sets expiration date. |
| void |
Sets the path attribute. |
| void |
Indicates whether the cookie had a path specified in a path attribute of the Set-Cookie header. |
| void |
Sets the secure attribute of the cookie. |
| void |
Sets the version of the cookie specification to which this cookie conforms. |
| String |
Return a textual representation of the cookie. |
| String |
Return a textual representation of the cookie. |
| Methods inherited from org.apache.commons.httpclientNameValuePair |
|---|
| Methods inherited from java.langObject |
|---|
public Cookie
(
)
public Cookie
(
String
domain,
String
name,
String
value,
String
path,
Date
expires,
boolean
secure
)
Compares two cookies to determine order for cookie header.
Most specific should be first.
This method is implemented so a cookie can be used as a comparator for a SortedSet of cookies. Specifically it's used above in the createCookieHeader method.
Note: the object returned by this method is considered immutable. Changing it (e.g. using setTime()) could result in undefined behaviour. Do so at your peril.
public
boolean
getSecure
(
)
public
int
getVersion
(
)
public
int
hashCode
(
)
public
boolean
isDomainAttributeSpecified
(
)
public
boolean
isExpired
(
)
public
boolean
isPathAttributeSpecified
(
)
public
boolean
isPersistent
(
)
public
void
setDomainAttributeSpecified
(
boolean
value
)
Note: the object returned by this method is considered immutable. Changing it (e.g. using setTime()) could result in undefined behaviour. Do so at your peril.
public
void
setPathAttributeSpecified
(
boolean
value
)
public
void
setSecure
(
boolean
secure
)
When true the cookie should only be sent using a secure protocol (https). This should only be set when the cookie's originating server used a secure protocol to set the cookie's value.
public
void
setVersion
(
int
version
)