public interface Cookie
Modifier and Type | Field and Description |
---|---|
static String |
DOMAIN_ATTR |
static String |
EXPIRES_ATTR |
static String |
HTTP_ONLY_ATTR |
static String |
MAX_AGE_ATTR |
static String |
PATH_ATTR |
static String |
SECURE_ATTR |
Modifier and Type | Method and Description |
---|---|
boolean |
containsAttribute(String name) |
String |
getAttribute(String name) |
Date |
getCreationDate()
Deprecated.
|
default Instant |
getCreationInstant()
Returns creation time of the cookie.
|
String |
getDomain()
Returns domain attribute of the cookie.
|
Date |
getExpiryDate()
Deprecated.
Use {
getExpiryInstant() } |
default Instant |
getExpiryInstant()
Returns the expiration
Instant of the cookie, or null if none exists. |
String |
getName()
Returns the name.
|
String |
getPath()
Returns the path attribute of the cookie.
|
String |
getValue()
Returns the value.
|
boolean |
isExpired(Date date)
Deprecated.
Use {
isExpired(Instant) } |
default boolean |
isExpired(Instant date)
Returns true if this cookie has expired.
|
default boolean |
isHttpOnly()
Checks whether this Cookie has been marked as
httpOnly . |
boolean |
isPersistent()
Returns
false if the cookie should be discarded at the end
of the "session"; true otherwise. |
boolean |
isSecure()
Indicates whether this cookie requires a secure connection.
|
static final String PATH_ATTR
static final String DOMAIN_ATTR
static final String MAX_AGE_ATTR
static final String SECURE_ATTR
static final String EXPIRES_ATTR
static final String HTTP_ONLY_ATTR
boolean containsAttribute(String name)
String getName()
String getValue()
@Deprecated Date getExpiryDate()
getExpiryInstant()
}Date
of the cookie, or null
if none exists.
Note: the object returned by this method is considered immutable. Changing it (e.g. using setTime()) could result in undefined behaviour. Do so at your peril.
Date
, or null
.default Instant getExpiryInstant()
Instant
of the cookie, or null
if none exists.
Note: the object returned by this method is considered immutable. Changing it (e.g. using setTime()) could result in undefined behaviour. Do so at your peril.
Instant
, or null
.boolean isPersistent()
false
if the cookie should be discarded at the end
of the "session"; true
otherwise.false
if the cookie should be discarded at the end
of the "session"; true
otherwiseString getDomain()
String getPath()
boolean isSecure()
true
if this cookie should only be sent
over secure connections, false
otherwise.@Deprecated boolean isExpired(Date date)
isExpired(Instant)
}date
- Current timetrue
if the cookie has expired.default boolean isExpired(Instant date)
date
- Current timetrue
if the cookie has expired.@Deprecated Date getCreationDate()
getCreationInstant()
default Instant getCreationInstant()
default boolean isHttpOnly()
httpOnly
.
The default implementation returns false
.
httpOnly
,
false otherwiseCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.