public class Cookie extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Cookie.SameSite |
Constructor and Description |
---|
Cookie()
Creates a new uninitialized cookie.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getComment()
Returns the intended use of a cookie.
|
String |
getCommentURL()
Returns the URL identifying the intended use of a cookie.
|
Boolean |
getDiscard()
Returns
true if the user agent should discard the cookie
unconditionally when it terminates. |
String |
getDomain()
Returns the domain for which the cookie is valid.
|
Date |
getExpires()
Returns the lifetime of the cookie, expressed as the date and time of
expiration.
|
Integer |
getMaxAge()
Returns the lifetime of the cookie, expressed in seconds.
|
String |
getName()
Returns name of the cookie.
|
String |
getPath()
Returns the subset of URLs on the origin server to which this cookie
applies.
|
List<Integer> |
getPort()
Returns the restricted list of port(s) to which a cookie may be returned.
|
Cookie.SameSite |
getSameSite()
Returns the SameSite policy for this cookie.
|
String |
getValue()
Returns the value of the cookie.
|
Integer |
getVersion()
Returns the version of the state management mechanism to which this
cookie conforms.
|
int |
hashCode() |
Boolean |
isHttpOnly()
Returns
true if the user agent should make the cookie
inaccessible to client side script. |
Boolean |
isSecure()
Returns
true if the user agent should use only secure means to
send back this cookie. |
Cookie |
setComment(String comment)
Sets the intended use of a cookie.
|
Cookie |
setCommentURL(String commentURL)
Sets the URL identifying the intended use of a cookie.
|
Cookie |
setDiscard(Boolean discard)
Sets the value indicating whether the user agent should discard the
cookie unconditionally when it terminates.
|
Cookie |
setDomain(String domain)
Sets the domain for which the cookie is valid.
|
Cookie |
setExpires(Date expires)
Sets the lifetime of the cookie, expressed as the date and time of
expiration.
|
Cookie |
setHttpOnly(Boolean httpOnly)
Sets the value indicating whether the user agent should make the cookie
inaccessible to client side script.
|
Cookie |
setMaxAge(Integer maxAge)
Sets the lifetime of the cookie, expressed in seconds.
|
Cookie |
setName(String name)
Sets the name of the cookie.
|
Cookie |
setPath(String path)
Sets the subset of URLs on the origin server to which this cookie
applies.
|
Cookie |
setSameSite(Cookie.SameSite sameSite) |
Cookie |
setSecure(Boolean secure)
Sets the value indicating whether the user agent should use only secure
means to send back this cookie.
|
Cookie |
setValue(String value)
Sets the value of the cookie.
|
Cookie |
setVersion(Integer version)
Sets the version of the state management mechanism to which this cookie
conforms.
|
String |
toString() |
public String getComment()
public String getCommentURL()
public Boolean getDiscard()
true
if the user agent should discard the cookie
unconditionally when it terminates.true
if the user agent should discard the cookie
unconditionally when it terminates.public String getDomain()
public Date getExpires()
public Boolean isHttpOnly()
true
if the user agent should make the cookie
inaccessible to client side script.true
if the user agent should make the cookie
inaccessible to client side script.public Integer getMaxAge()
public String getName()
public String getPath()
public List<Integer> getPort()
public Boolean isSecure()
true
if the user agent should use only secure means to
send back this cookie.true
if the user agent should use only secure means to
send back this cookie.public String getValue()
public Integer getVersion()
public Cookie.SameSite getSameSite()
public Cookie setComment(String comment)
comment
- The intended use of a cookie.public Cookie setCommentURL(String commentURL)
commentURL
- The URL identifying the intended use of a cookie.public Cookie setDiscard(Boolean discard)
discard
- true
if the user agent should discard the cookie
unconditionally when it terminates.public Cookie setDomain(String domain)
domain
- The domain for which the cookie is valid.public Cookie setExpires(Date expires)
expires
- The lifetime of the cookie, expressed as the date and time of
expiration.public Cookie setHttpOnly(Boolean httpOnly)
httpOnly
- true
if the user agent should make the cookie
inaccessible to client side script.public Cookie setMaxAge(Integer maxAge)
maxAge
- The lifetime of the cookie, expressed in seconds.public Cookie setName(String name)
name
- The name of the cookie.public Cookie setPath(String path)
path
- The subset of URLs on the origin server to which this cookie
applies.public Cookie setSecure(Boolean secure)
secure
- true
if the user agent should use only secure means to
send back this cookie.public Cookie setSameSite(Cookie.SameSite sameSite)
public Cookie setValue(String value)
value
- The value of the cookie.public Cookie setVersion(Integer version)
version
- The version of the state management mechanism to which this
cookie conforms.Copyright © 2025 Open Identity Platform Community. All rights reserved.