Skip to content

Most visited

Recently visited


NetscapeDraftSpec | Android Developers

to top
Android APIs
public class


extends CookieSpecBase
   ↳ org.apache.http.impl.cookie.AbstractCookieSpec
     ↳ org.apache.http.impl.cookie.CookieSpecBase
       ↳ org.apache.http.impl.cookie.NetscapeDraftSpec

Class Overview

Netscape cookie draft compliant cookie policy


Public Constructors
NetscapeDraftSpec(String[] datepatterns)
Default constructor
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.
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


protected static final String EXPIRES_PATTERN

Added in API level 1

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

Public Constructors

public NetscapeDraftSpec (String[] datepatterns)

Added in API level 1

Default constructor

public NetscapeDraftSpec ()

Added in API level 1

Default constructor

Public Methods

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

Added in API level 1

public int getVersion ()

Added in API level 1

public Header getVersionHeader ()

Added in API level 1

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

Added in API level 1

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.

header the Set-Cookie received from the server
  • an array of Cookies parsed from the Set-Cookie value
MalformedCookieException if an exception occurs during parsing
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.