org.apache.commons.httpclient.cookie
Class NetscapeDraftSpec
- CookieSpec
public class NetscapeDraftSpec
Netscape cookie draft specific cookie management functions
boolean | domainMatch(String host, String domain) - Performs domain-match as described in the Netscape draft.
|
Cookie[] | parse(String host, int port, String path, boolean secure, String header) - Parses the Set-Cookie value into an array of Cookies.
|
void | parseAttribute(NameValuePair attribute, Cookie cookie) - Parse the cookie attribute and update the corresponsing
Cookie
properties as defined by the Netscape draft specification
|
void | validate(String host, int port, String path, boolean secure, Cookie cookie) - Performs Netscape draft compliant
Cookie validation
|
domainMatch , formatCookie , formatCookieHeader , formatCookieHeader , formatCookies , getValidDateFormats , match , match , parse , parse , parseAttribute , pathMatch , setValidDateFormats , validate |
NetscapeDraftSpec
public NetscapeDraftSpec()
Default constructor
domainMatch
public boolean domainMatch(String host,
String domain)
Performs domain-match as described in the Netscape draft.
- domainMatch in interface CookieSpec
- domainMatch in interface CookieSpecBase
host
- The target host.domain
- The cookie domain attribute.
- true if the specified host matches the given domain.
parse
public Cookie[] parse(String host,
int port,
String path,
boolean secure,
String header)
throws MalformedCookieException
Parses the Set-Cookie value into an array of
Cookies.
Syntax of the Set-Cookie HTTP Response Header:
This is the format a CGI script would use to add to
the HTTP headers a new piece of data which is to be stored by
the client for later retrieval.
Set-Cookie: NAME=VALUE; expires=DATE; path=PATH; domain=DOMAIN_NAME; secure
Please note that Netscape draft specification does not fully
conform to the HTTP header format. Netscape draft does not specify
whether multiple cookies may be sent in one header. Hence, comma
character may be present in unquoted cookie value or unquoted
parameter value.
http://wp.netscape.com/newsref/std/cookie_spec.html
- parse in interface CookieSpec
- parse in interface CookieSpecBase
host
- the host from which the Set-Cookie value was
receivedport
- the port from which the Set-Cookie value was
receivedpath
- the path from which the Set-Cookie value was
receivedsecure
- true when the Set-Cookie value was
received over secure conectionheader
- the Set-Cookie received from the server
- an array of Cookies parsed from the Set-Cookie value
Copyright (c) 1999-2005 - Apache Software Foundation