public interface Cookie
| Modifier and Type | Method and Description |
|---|---|
String |
getDomain()
Gets the cookie domain.
|
Date |
getExpires()
Gets the date the cookie will expire at.
|
String |
getName()
Gets the cookie name.
|
String |
getPath()
Gets the cookie path.
|
String |
getValue()
Gets the cookie value.
|
int |
getVersion()
Gets the cookie version.
|
boolean |
isDiscard()
Is this cookie to be discarded?
|
boolean |
isExpired()
Is this cookie expired?
|
boolean |
isHttpOnly()
Is the cookie availableto the server
and not to javascript?
|
boolean |
isSecure()
Is the "secure" feature on?
|
void |
setDomain(String domain)
Sets the cookie domain.
|
void |
setExpires(Date expires)
Sets the date the cookie will expire.
|
void |
setExpiresUsingMaxAge(int maxAge)
Sets the number of seconds for a cookie to live.
|
void |
setHttpOnly(boolean httpOnly)
Sets if the cookie is available only for to the server
anbd not to javascript.
|
void |
setPath(String path)
Sets the cookie path.
|
void |
setSecure(boolean secure)
Sets the "secure" feature on or off.
|
void |
setValue(String value)
Sets the cookie value.
|
String getName()
String getValue()
void setValue(String value)
String getPath()
void setPath(String path)
String getDomain()
void setDomain(String domain)
Date getExpires()
null the cookie will live for the current session
(this is the default).void setExpires(Date expires)
null the cookie will live for the current session
(this is the default).void setExpiresUsingMaxAge(int maxAge)
maxAge < 0 : The "Expires date" will be in the past and the cookie will
therefore be deleted.
If maxAge == 0 : The "Expires date" will be null and the cookie will live
for the session only.
If maxAge > 0 : The "Expires date" will be the current date + 'maxAge' seconds.boolean isExpired()
boolean isSecure()
void setSecure(boolean secure)
boolean isHttpOnly()
void setHttpOnly(boolean httpOnly)
boolean isDiscard()
int getVersion()
Copyright © 2018. All rights reserved.