public class CookieDefaults extends Object implements IClusterable
CookieUtils
class when it creates cookies.Constructor and Description |
---|
CookieDefaults() |
Modifier and Type | Method and Description |
---|---|
String |
getComment()
Gets the cookie comment.
|
String |
getDomain()
Gets the cookie domain name.
|
int |
getMaxAge()
Gets the max age.
|
boolean |
getSecure()
Returns true if the browser is sending cookies only over a secure protocol, or false if the
browser can send cookies using any protocol.
|
int |
getVersion()
Returns the version of the protocol this cookie complies with.
|
boolean |
isHttpOnly()
Checks whether this Cookie has been marked as HttpOnly.
|
void |
setComment(String comment)
Sets the cookie comment.
|
void |
setDomain(String domain)
Sets the cookie domain name.
|
void |
setHttpOnly(boolean httpOnly)
Marks or unmarks this Cookie as HttpOnly.
|
void |
setMaxAge(int maxAge)
Sets the maximum age of the cookie in seconds.
|
void |
setSecure(boolean secure)
Indicates to the browser whether the cookie should only be sent using a secure protocol, such
as HTTPS or SSL.
|
void |
setVersion(int version)
Sets the version of the cookie protocol this cookie complies with.
|
public int getMaxAge()
public void setMaxAge(int maxAge)
maxAge
- the max age in seconds.public String getComment()
public void setComment(String comment)
comment
- the cookie commentpublic String getDomain()
public void setDomain(String domain)
domain
- the cookie domain namepublic boolean getSecure()
public void setSecure(boolean secure)
secure
- if true, sends the cookie from the browser to the server using only when using a
secure protocol; if false, sent on any protocolpublic int getVersion()
public void setVersion(int version)
version
- 0 if the cookie should comply with the original Netscape specification; 1 if the
cookie should comply with RFC 2109public boolean isHttpOnly()
public void setHttpOnly(boolean httpOnly)
HttpOnly cookies are not supposed to be exposed to client-side scripting code, and may therefore help mitigate certain kinds of cross-site scripting attacks.
httpOnly
- true if this cookie is to be marked as HttpOnly, false otherwiseCopyright © 2006–2022 Apache Software Foundation. All rights reserved.