public class Cookie extends Object implements Serializable
| 限定符和类型 | 类和说明 |
|---|---|
static class |
Cookie.Builder |
| 构造器和说明 |
|---|
Cookie(String name,
String value)
Create a cookie for the default path with the given name and value with no expiry set.
|
Cookie(String name,
String value,
String path)
Create a cookie.
|
Cookie(String name,
String value,
String path,
Date expiry)
Creates an insecure non-httpOnly cookie with no domain specified.
|
Cookie(String name,
String value,
String domain,
String path,
Date expiry)
Creates an insecure non-httpOnly cookie.
|
Cookie(String name,
String value,
String domain,
String path,
Date expiry,
boolean isSecure)
Creates a non-httpOnly cookie.
|
Cookie(String name,
String value,
String domain,
String path,
Date expiry,
boolean isSecure,
boolean isHttpOnly)
Creates a cookie.
|
public Cookie(String name, String value, String path, Date expiry)
name - The name of the cookie; may not be null or an empty string.value - The cookie value; may not be null.path - The path the cookie is visible to. If left blank or set to null, will be set to
"/".expiry - The cookie's expiration date; may be null.Cookie(String, String, String, String, Date)public Cookie(String name, String value, String domain, String path, Date expiry)
name - The name of the cookie; may not be null or an empty string.value - The cookie value; may not be null.domain - The domain the cookie is visible to.path - The path the cookie is visible to. If left blank or set to null, will be set to
"/".expiry - The cookie's expiration date; may be null.Cookie(String, String, String, String, Date, boolean)public Cookie(String name, String value, String domain, String path, Date expiry, boolean isSecure)
name - The name of the cookie; may not be null or an empty string.value - The cookie value; may not be null.domain - The domain the cookie is visible to.path - The path the cookie is visible to. If left blank or set to null, will be set to
"/".expiry - The cookie's expiration date; may be null.isSecure - Whether this cookie requires a secure connection.public Cookie(String name, String value, String domain, String path, Date expiry, boolean isSecure, boolean isHttpOnly)
name - The name of the cookie; may not be null or an empty string.value - The cookie value; may not be null.domain - The domain the cookie is visible to.path - The path the cookie is visible to. If left blank or set to null, will be set to
"/".expiry - The cookie's expiration date; may be null.isSecure - Whether this cookie requires a secure connection.isHttpOnly - Whether this cookie is a httpOnly cooke.public Cookie(String name, String value)
name - The cookie's namevalue - The cookie's valuepublic String getName()
public String getValue()
public String getDomain()
public String getPath()
public boolean isSecure()
public boolean isHttpOnly()
public Date getExpiry()
public void validate()
public boolean equals(Object o)