HttpCookie

public final class HttpCookie extends Object
implements Cloneable

An HttpCookie object represents an http cookie, which carries state information between server and user agent. Cookie is widely adopted to create stateful sessions.

There are 3 http cookie specifications:

Netscape draft
RFC 2109 - http://www.ietf.org/rfc/rfc2109.txt
RFC 2965 - http://www.ietf.org/rfc/rfc2965.txt

HttpCookie class can accept all these 3 forms of syntax.

Public Constructor Summary

HttpCookie(String name, String value)
Constructs a cookie with a specified name and value.

Public Method Summary

Object
clone()
Create and return a copy of this object.
static boolean
domainMatches(String domain, String host)
The utility method to check whether a host name is in a domain or not.
boolean
equals(Object obj)
Test the equality of two http cookies.
String
getComment()
Returns the comment describing the purpose of this cookie, or null if the cookie has no comment.
String
getCommentURL()
Returns the comment url describing the purpose of this cookie, or null if the cookie has no comment url.
boolean
getDiscard()
Return the discard attribute of the cookie
String
getDomain()
Returns the domain name set for this cookie.
long