@Obsolete @Contract(threading=SAFE) public class NetscapeDraftSpec extends CookieSpecBase
RFC6265LaxSpec
| Modifier and Type | Field and Description |
|---|---|
protected static String |
EXPIRES_PATTERN |
| Constructor and Description |
|---|
NetscapeDraftSpec() |
NetscapeDraftSpec(String[] datepatterns)
默认构造函数
|
| Modifier and Type | Method and Description |
|---|---|
List<Header> |
formatCookies(List<Cookie> cookies)
为一系列Cookie创建
"Cookie"标题。
|
int |
getVersion()
返回该cookie规范符合的状态管理版本。
|
Header |
getVersionHeader()
返回一个标识什么版本的状态管理规范被理解的请求头。
|
List<Cookie> |
parse(Header header, CookieOrigin origin)
将Set-Cookie值解析为
Cookie的数组。
|
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
Cookie的数组。
Set-Cookie HTTP响应头的语法:
这是CGI脚本用于向HTTP标头添加新的数据的格式,客户端将要存储的一段数据以供以后检索。
Set-Cookie: NAME=VALUE; expires=DATE; path=PATH; domain=DOMAIN_NAME; secure
请注意,Netscape草案规范不完全符合HTTP头格式。 如果Set-Cookie存在逗号字符,则不会被视为标题元素分隔符
header - 从服务器接收的
Set-Cookie
origin - cookie起源的细节
Cookie的数组
MalformedCookieException - 如果在解析期间发生异常
public List<Header> formatCookies(List<Cookie> cookies)
CookieSpec复制
"Cookie"标题。
cookies - 将Cookie格式转换为Cookie标题
public int getVersion()
CookieSpec复制
public Header getVersionHeader()
CookieSpec复制
Cookie2标题,可能是null 。
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.