public class Cookie extends Object
Modifier and Type | Method and Description |
---|---|
static Cookie |
buildCookie(Map<String,String> cookieMap)
通过 Map 构建一个 Cookie 对象
|
String |
getDomain() |
String |
getExpires() |
int |
getMaxAge() |
String |
getName() |
String |
getPath() |
String |
getValue() |
boolean |
isHttpOnly() |
boolean |
isSecure() |
static Cookie |
newInstance(Request request,
String name,
String value)
创建一个 Cookie
|
static Cookie |
newInstance(Request request,
String path,
String name,
String value)
创建一个 Cookie
|
static Cookie |
newInstance(Request request,
String path,
String name,
String value,
int maxAge,
boolean isHttpOnly)
创建一个 Cookie
|
static Cookie |
newInstance(String domain,
String path,
String name,
String value,
int maxAge,
boolean isHttpOnly)
创建一个 Cookie
|
void |
setDomain(String domain) |
void |
setExpires(String expires) |
void |
setHttpOnly(boolean httpOnly) |
void |
setMaxAge(int maxAge) |
void |
setName(String name) |
void |
setPath(String path) |
void |
setSecure(boolean secure) |
void |
setValue(String value) |
String |
toString() |
public String getDomain()
public void setDomain(String domain)
public String getPath()
public void setPath(String path)
public int getMaxAge()
public void setMaxAge(int maxAge)
public String getExpires()
public void setExpires(String expires)
public boolean isSecure()
public void setSecure(boolean secure)
public boolean isHttpOnly()
public void setHttpOnly(boolean httpOnly)
public String getName()
public void setName(String name)
public String getValue()
public void setValue(String value)
public static Cookie buildCookie(Map<String,String> cookieMap)
cookieMap
- Cookie 属性 Mappublic static Cookie newInstance(String domain, String path, String name, String value, int maxAge, boolean isHttpOnly)
domain
- cookie的受控域path
- cookie路径name
- 名称value
- 值maxAge
- 失效时间,单位秒isHttpOnly
- httpOnly属性public static Cookie newInstance(Request request, String path, String name, String value, int maxAge, boolean isHttpOnly)
request
- 请求对象path
- cookie路径name
- 名称value
- 值maxAge
- 失效时间,单位秒isHttpOnly
- httpOnly属性public static Cookie newInstance(Request request, String path, String name, String value)
request
- 请求对象path
- cookie路径name
- 名称value
- 值Copyright © 2020 Voovan. All rights reserved.