public class Cookie extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Cookie.SameSite |
Modifier and Type | Field and Description |
---|---|
static DateTimeFormatter |
DEFAULT_PATTERN |
Constructor and Description |
---|
Cookie(String v)
Construct a cookie from a set-cookie value
|
Cookie(String name,
String value) |
Modifier and Type | Method and Description |
---|---|
String |
getDomain() |
ZonedDateTime |
getExpiration()
Per Wikipedia:
The Expires attribute defines a specific date and time for when the browser should delete the cookie.
|
int |
getMaxAge()
Per Wikipedia:
the Max-Age attribute can be used to set the cookie's expiration as an interval of seconds in the future,
relative to the time the browser received the cookie.
|
String |
getName() |
String |
getPath() |
Cookie.SameSite |
getSameSite()
returns the SameSite attribute
|
String |
getUrlDecodedValue() |
String |
getValue() |
boolean |
isHttpOnly()
Per Wikipedia:
The HttpOnly attribute directs browsers not to expose cookies through channels other than HTTP (and HTTPS) requests.
|
boolean |
isSecure()
Per Wikipedia:
The Secure attribute is meant to keep cookie communication limited to encrypted transmission,
directing browsers to use cookies only via secure/encrypted connections.
|
void |
setDomain(String domain) |
void |
setHttpOnly(boolean httpOnly) |
void |
setPath(String path) |
String |
toString() |
public static final DateTimeFormatter DEFAULT_PATTERN
public Cookie(String v)
v
- cookie string valuepublic void setDomain(String domain)
public void setPath(String path)
public void setHttpOnly(boolean httpOnly)
public String getName()
public String getValue()
public String getUrlDecodedValue()
public String getDomain()
public String getPath()
public boolean isHttpOnly()
public boolean isSecure()
public int getMaxAge()
public ZonedDateTime getExpiration()
public Cookie.SameSite getSameSite()
Copyright © 2020. All rights reserved.