public class

NetscapeDraftSpec

extends CookieSpecBase
java.lang.Object
   ↳ org.apache.http.impl.cookie.AbstractCookieSpec
     ↳ org.apache.http.impl.cookie.CookieSpecBase
       ↳ org.apache.http.impl.cookie.NetscapeDraftSpec

Class Overview

This CookieSpec implementation conforms to the original draft specification published by Netscape Communications. It should be avoided unless absolutely necessary for compatibility with legacy code.

Summary

Constants
String EXPIRES_PATTERN
Public Constructors
NetscapeDraftSpec(String[] datepatterns)
Default constructor
NetscapeDraftSpec()
Default constructor
Public Methods
List<Header> formatCookies(List<Cookie> cookies)
int getVersion()
Header getVersionHeader()
List<Cookie> parse(Header header, CookieOrigin origin)
Parses the Set-Cookie value into an array of Cookies.
String toString()
[Expand]
Inherited Methods
From class org.apache.http.impl.cookie.CookieSpecBase
From class org.apache.http.impl.cookie.AbstractCookieSpec
From class java.lang.Object
From interface org.apache.http.cookie.CookieSpec

Constants

protected static final String EXPIRES_PATTERN

Also: HttpClient

Constant Value: "EEE, dd-MMM-yy HH:mm:ss z"

Public Constructors

public NetscapeDraftSpec (String[] datepatterns)

Also: HttpClient

Default constructor

public NetscapeDraftSpec ()

Also: HttpClient

Default constructor

Public Methods

public List<Header> formatCookies (List<Cookie> cookies)

Also: HttpClient

public int getVersion ()

Also: HttpClient

public Header getVersionHeader ()

Also: HttpClient

public List<Cookie> parse (Header header, CookieOrigin origin)

Also: HttpClient

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 the Netscape draft specification does not fully conform to the HTTP header format. Comma character if present in Set-Cookie will not be treated as a header element separator

Parameters
header the Set-Cookie received from the server
Returns
  • an array of Cookies parsed from the Set-Cookie value
Throws
MalformedCookieException if an exception occurs during parsing

public String toString ()