@NotThreadSafe public class NetscapeDraftSpec extends CookieSpecBase
CookieSpec implementation conforms to the original draft
specification published by Netscape Communications. It should be avoided
unless absolutely necessary for compatibility with legacy code.| Modifier and Type | Field and Description |
|---|---|
protected static String |
EXPIRES_PATTERN |
| Constructor and Description |
|---|
NetscapeDraftSpec()
Default constructor
|
NetscapeDraftSpec(String[] datepatterns)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
List<Header> |
formatCookies(List<Cookie> cookies)
Create "Cookie" headers for an array of Cookies.
|
int |
getVersion()
Returns version of the state management this cookie specification
conforms to.
|
Header |
getVersionHeader()
Returns a request header identifying what version of the state management
specification is understood.
|
List<Cookie> |
parse(Header header,
CookieOrigin origin)
Parses the Set-Cookie value into an array of Cookies.
|
String |
toString() |
getDefaultDomain, getDefaultPath, match, parse, validatefindAttribHandler, getAttribHandler, getAttribHandlers, registerAttribHandlerprotected static final String EXPIRES_PATTERN
public NetscapeDraftSpec(String[] datepatterns)
public NetscapeDraftSpec()
public List<Cookie> parse(Header header, CookieOrigin origin) throws MalformedCookieException
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
header - the Set-Cookie received from the serverorigin - details of the cookie originMalformedCookieException - if an exception occurs during parsingpublic List<Header> formatCookies(List<Cookie> cookies)
CookieSpeccookies - the Cookies format into a Cookie headerpublic int getVersion()
CookieSpecpublic Header getVersionHeader()
CookieSpecnull if the cookie
specification does not support Cookie2 header.Copyright © 1999–2013 The Apache Software Foundation. All rights reserved.