org.apache.http.impl.cookie.BasicClientCookie2
HTTP "magic-cookie" represents a piece of state information
that the HTTP agent and the target server can exchange to maintain
a session as specified by RFC2965.
Summary
Public Constructors
Public Methods
clone,
containsAttribute,
getAttribute,
getComment,
getCommentURL,
getDomain,
getExpiryDate,
getName,
getPath,
getPorts,
getValue,
getVersion,
isExpired,
isPersistent,
isSecure,
setAttribute,
setComment,
setDomain,
setExpiryDate,
setPath,
setSecure,
setValue,
setVersion,
toString
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
getComment,
getCommentURL,
getDomain,
getExpiryDate,
getName,
getPath,
getPorts,
getValue,
getVersion,
isExpired,
isPersistent,
isSecure
Details
Public Constructors
public
BasicClientCookie2(String name, String value)
Default Constructor taking a name and a value. The value may be null.
Parameters
| name
| The name. |
| value
| The value.
|
Public Methods
public
Object
clone()
Returns a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver.
Classes which wish to support cloning must specify that they implement
the Cloneable interface, since the implementation checks for this.
public
String
getCommentURL()
Returns null. Cookies prior to RFC2965 do not set this attribute
public
int[]
getPorts()
Returns null. Cookies prior to RFC2965 do not set this attribute
public
boolean
isExpired(Date date)
Returns true if this cookie has expired.
Returns
- true if the cookie has expired.
public
boolean
isPersistent()
Returns
false if the cookie should be discarded at the end
of the "session";
true otherwise.
Returns
- false if the cookie should be discarded at the end
of the "session"; true otherwise
public
void
setCommentURL(String commentURL)
If a user agent (web browser) presents this cookie to a user, the
cookie's purpose will be described by the information at this URL.
public
void
setDiscard(boolean discard)
Set the Discard attribute.
Note: Discard attribute overrides Max-age.
public
void
setPorts(int[] ports)
Sets the Port attribute. It restricts the ports to which a cookie
may be returned in a Cookie request header.