Package io.undertow.server.handlers
Interface Cookie
- All Superinterfaces:
Comparable
- All Known Implementing Classes:
CookieImpl
A HTTP cookie.
- Author:
- Stuart Douglas
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault intdefault StringgetAttribute(String name) Returns the attribute associated with the name ornullif no attribute is associated with the name.Returns an unmodifiable map of the attributes associated with this cookie.getName()getPath()default StringgetValue()intbooleanbooleandefault booleanbooleanisSecure()default CookiesetAttribute(String name, String value) Sets an attribute for the cookie.setComment(String comment) setDiscard(boolean discard) setExpires(Date expires) setHttpOnly(boolean httpOnly) default CookiesetSameSite(boolean sameSite) Deprecated, for removal: This API element is subject to removal in a future version.default CookiesetSameSiteMode(String mode) setSecure(boolean secure) setVersion(int version)
-
Field Details
-
COOKIE_COMMENT_ATTR
- See Also:
-
COOKIE_DOMAIN_ATTR
- See Also:
-
COOKIE_MAX_AGE_ATTR
- See Also:
-
COOKIE_PATH_ATTR
- See Also:
-
COOKIE_SECURE_ATTR
- See Also:
-
COOKIE_HTTP_ONLY_ATTR
- See Also:
-
COOKIE_SAME_SITE_ATTR
- See Also:
-
COOKIE_DISCARD_ATTR
- See Also:
-
COOKIE_EXPIRES_ATTR
- See Also:
-
-
Method Details
-
getName
String getName() -
getValue
String getValue() -
setValue
-
getPath
String getPath() -
setPath
-
getDomain
String getDomain() -
setDomain
-
getMaxAge
Integer getMaxAge() -
setMaxAge
-
isDiscard
boolean isDiscard() -
setDiscard
-
isSecure
boolean isSecure() -
setSecure
-
getVersion
int getVersion() -
setVersion
-
isHttpOnly
boolean isHttpOnly() -
setHttpOnly
-
getExpires
Date getExpires() -
setExpires
-
getComment
String getComment() -
setComment
-
isSameSite
default boolean isSameSite() -
setSameSite
Deprecated, for removal: This API element is subject to removal in a future version. -
getSameSiteMode
-
setSameSiteMode
-
getAttribute
Returns the attribute associated with the name ornullif no attribute is associated with the name.- Parameters:
name- the name of the attribute- Returns:
- the value or
nullif not found
-
setAttribute
Sets an attribute for the cookie. If the value isnull, the attribute is removed. If the value is notnull, the attribute is added to the attributes for this cookie. If name match pre-existing attribute, like "COOKIE_PATH_ATTR" it will override that value- Parameters:
name- the name of the attributevalue- the value of the attribute ornullto remove it- Returns:
- this cookie
-
getAttributes
Returns an unmodifiable map of the attributes associated with this cookie.- Returns:
- an unmodifiable map of the attributes
-
compareTo
- Specified by:
compareToin interfaceComparable
-