public interface Cookie extends Comparable<Cookie>
Modifier and Type | Field and Description |
---|---|
static long |
UNDEFINED_MAX_AGE
Constant for undefined MaxAge attribute value.
|
Modifier and Type | Method and Description |
---|---|
String |
domain()
Returns the domain of this
Cookie . |
boolean |
isHttpOnly()
Checks to see if this
Cookie can only be accessed via HTTP. |
boolean |
isSecure()
Checks to see if this
Cookie is secure |
long |
maxAge()
Returns the maximum age of this
Cookie in seconds or UNDEFINED_MAX_AGE if unspecified |
String |
name()
Returns the name of this
Cookie . |
String |
path()
Returns the path of this
Cookie . |
void |
setDomain(String domain)
Sets the domain of this
Cookie . |
void |
setHttpOnly(boolean httpOnly)
Determines if this
Cookie is HTTP only. |
void |
setMaxAge(long maxAge)
Sets the maximum age of this
Cookie in seconds. |
void |
setPath(String path)
Sets the path of this
Cookie . |
void |
setSecure(boolean secure)
Sets the security getStatus of this
Cookie |
void |
setValue(String value)
Sets the value of this
Cookie . |
void |
setWrap(boolean wrap)
Sets true if the value of this
Cookie
is to be wrapped with double quotes. |
String |
value()
Returns the value of this
Cookie . |
boolean |
wrap()
Returns true if the raw value of this
Cookie ,
was wrapped with double quotes in original Set-Cookie header. |
compareTo
static final long UNDEFINED_MAX_AGE
void setValue(String value)
Cookie
.value
- The value to setboolean wrap()
Cookie
,
was wrapped with double quotes in original Set-Cookie header.Cookie
is to be wrappedvoid setWrap(boolean wrap)
Cookie
is to be wrapped with double quotes.wrap
- true if wrapvoid setDomain(String domain)
Cookie
.domain
- The domain to usevoid setPath(String path)
Cookie
.path
- The path to use for this Cookie
long maxAge()
Cookie
in seconds or UNDEFINED_MAX_AGE
if unspecifiedCookie
void setMaxAge(long maxAge)
Cookie
in seconds.
If an age of 0
is specified, this Cookie
will be
automatically removed by browser because it will expire immediately.
If UNDEFINED_MAX_AGE
is specified, this Cookie
will be removed when the
browser is closed.maxAge
- The maximum age of this Cookie
in secondsboolean isSecure()
Cookie
is secureCookie
is secure, otherwise falsevoid setSecure(boolean secure)
Cookie
secure
- True if this Cookie
is to be secure, otherwise falseboolean isHttpOnly()
Cookie
can only be accessed via HTTP.
If this returns true, the Cookie
cannot be accessed through
client side script - But only if the browser supports it.
For more information, please look hereCookie
is HTTP-only or false if it isn'tvoid setHttpOnly(boolean httpOnly)
Cookie
is HTTP only.
If set to true, this Cookie
cannot be accessed by a client
side script. However, this works only if the browser supports it.
For information, please look
here.httpOnly
- True if the Cookie
is HTTP only, otherwise false.Copyright © 2008–2024 The Netty Project. All rights reserved.