Modifier and Type | Field and Description |
---|---|
static TypeArg<Cookie> |
__TYPE_ARG |
Modifier and Type | Method and Description |
---|---|
static Cookie |
cookie(String name,
String value)
Create a new cookie
|
String |
encode()
Encode the cookie to a string.
|
boolean |
equals(Object o) |
Cookie |
getDelegate() |
String |
getDomain() |
String |
getName() |
String |
getPath() |
String |
getValue() |
int |
hashCode() |
static Cookie |
newInstance(Cookie arg) |
Cookie |
setDomain(String domain)
Sets the domain of this cookie
|
Cookie |
setHttpOnly(boolean httpOnly)
Determines if this cookie is HTTP only.
|
Cookie |
setMaxAge(long maxAge)
Sets the maximum age of this cookie in seconds.
|
Cookie |
setPath(String path)
Sets the path of this cookie.
|
Cookie |
setSecure(boolean secure)
Sets the security getStatus of this cookie
|
Cookie |
setValue(String value)
Sets the value of this cookie
|
String |
toString() |
public Cookie(Cookie delegate)
public Cookie getDelegate()
public static Cookie cookie(String name, String value)
name
- the name of the cookievalue
- the cookie valuepublic String getName()
public String getValue()
public Cookie setValue(String value)
value
- The value to setpublic Cookie setDomain(String domain)
domain
- The domain to usepublic String getDomain()
public Cookie setPath(String path)
path
- The path to use for this cookiepublic String getPath()
public Cookie setMaxAge(long maxAge)
0
is specified, this cookie will be
automatically removed by browser because it will expire immediately.
If Long
is specified, this cookie will be removed when the
browser is closed.
If you don't set this the cookie will be a session cookie and be removed when the browser is closed.maxAge
- The maximum age of this cookie in secondspublic Cookie setSecure(boolean secure)
secure
- True if this cookie is to be secure, otherwise falsepublic Cookie setHttpOnly(boolean httpOnly)
httpOnly
- True if the cookie is HTTP only, otherwise false.public String encode()
Copyright © 2019 Eclipse. All rights reserved.