FileDocCategorySizeDatePackage
Cookie.javaAPI DocAndroid 1.5 API4170Wed May 06 22:41:10 BST 2009org.apache.http.cookie

Cookie

public interface Cookie
HTTP "magic-cookie" represents a piece of state information that the HTTP agent and the target server can exchange to maintain a session.
author
Oleg Kalnichevski
since
4.0

Fields Summary
Constructors Summary
Methods Summary
public java.lang.StringgetComment()
Returns the comment describing the purpose of this cookie, or null if no such comment has been defined.

return
comment

public java.lang.StringgetCommentURL()
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 java.lang.StringgetDomain()
Returns domain attribute of the cookie.

return
the value of the domain attribute

public java.util.DategetExpiryDate()
Returns the expiration {@link Date} of the cookie, or null if none exists.

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.

return
Expiration {@link Date}, or null.

public java.lang.StringgetName()
Returns the name.

return
String name The name

public java.lang.StringgetPath()
Returns the path attribute of the cookie

return
The value of the path attribute.

public int[]getPorts()
Get the Port attribute. It restricts the ports to which a cookie may be returned in a Cookie request header.

public java.lang.StringgetValue()
Returns the value.

return
String value The current value.

public intgetVersion()
Returns the version of the cookie specification to which this cookie conforms.

return
the version of the cookie.

public booleanisExpired(java.util.Date date)
Returns true if this cookie has expired.

param
date Current time
return
true if the cookie has expired.

public booleanisPersistent()
Returns false if the cookie should be discarded at the end of the "session"; true otherwise.

return
false if the cookie should be discarded at the end of the "session"; true otherwise

public booleanisSecure()
Indicates whether this cookie requires a secure connection.

return
true if this cookie should only be sent over secure connections, false otherwise.