public final class SessionCookieConfig extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DYNAMIC_SECURE
The value that allows the JSESSIONID cookie's secure attribute to
be configured based on the connection i.e.
|
Constructor and Description |
---|
SessionCookieConfig()
Construct a new SessionCookieConfig with default properties.
|
SessionCookieConfig(String name,
String path,
int maxAge,
String domain,
String comment)
Construct a new SessionCookieConfig with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
String |
getComment()
Return the URLEncoded form of the comment that identifies the session
cookie.
|
String |
getDomain()
Return the domain for which the cookie is valid.
|
Boolean |
getHttpOnly() |
Integer |
getMaxAge()
Return the expiration time for the session cookie.
|
String |
getName()
Return the name of the session tracking cookie.
|
String |
getPath()
Return the path that is set when the session tracking cookie is
created.
|
String |
getSecure()
Return whether the cookie is to be marked Secure or not.
|
void |
setComment(String comment)
Set the comment that identifies the session cookie.
|
void |
setDomain(String domain)
Set the domain for which the cookie is valid.
|
void |
setHttpOnly(Boolean httpOnly) |
void |
setMaxAge(Integer maxAge)
Set the expiration time for the session cookie.
|
void |
setName(String name)
Set the name of the session tracking cookie (currently not supported).
|
void |
setPath(String path)
Set the path to use when creating the session tracking cookie.
|
void |
setSecure(String secure)
Set whether the cookie is marked Secure or not.
|
String |
toString()
Return a String representation of this object.
|
public static final String DYNAMIC_SECURE
public SessionCookieConfig()
public SessionCookieConfig(String name, String path, int maxAge, String domain, String comment)
name
- The name of the cookie used for session trackingpath
- The pathname that is set when the cookie is createdmaxAge
- The expiration time (in seconds) of the session cookie
(-1 indicates 'never expire')domain
- The domain for which the cookie is validcomment
- The comment that identifies the session tracking cookie
in the cookie file.public void setName(String name)
public String getName()
public void setPath(String path)
public String getPath()
public void setMaxAge(Integer maxAge)
public Integer getMaxAge()
public void setDomain(String domain)
public String getDomain()
public void setComment(String comment)
public String getComment()
public void setSecure(String secure) throws IllegalArgumentException
secure
- Valid values are "dynamic", "true" or "false"IllegalArgumentException
public String getSecure()
public void setHttpOnly(Boolean httpOnly)
public Boolean getHttpOnly()
Copyright © 2021. All rights reserved.