public class SessionCookieConfig extends Object
Attributes are shared with ClientSideSessionConfig
that is used by client side session (cookie based).
ClientSideSessionConfig
Constructor and Description |
---|
SessionCookieConfig() |
Modifier and Type | Method and Description |
---|---|
SessionCookieConfig |
domain(String domain)
Set the
domain for session cookie. |
SessionCookieConfig |
expires(Duration expiresDuration)
Set max age of the cookies related to session management.
|
String |
getDomain()
Use the session cookie only when requesting from the
domain . |
Duration |
getExpires()
Cookie's max age.
|
String |
getIdName()
The name of the cookie for session id.
|
String |
getPath()
Use the session cookie only when requesting from the
path . |
SessionCookieConfig |
httpOnly(boolean httpOnly)
Set session cookies attribute
HttpOnly . |
SessionCookieConfig |
idName(String idName)
Set the name of the cookie for session id.
|
boolean |
isHttpOnly()
HttpOnly cookies can only be used when transmitted via HTTP/HTTPS . |
boolean |
isSecure()
Secure cookies can only be transmitted over encrypted connection like HTTPS |
SessionCookieConfig |
path(String path)
Set the
path for session cookie. |
SessionCookieConfig |
secure(boolean secure)
Set session cookies attribute
Secure . |
void |
setDomain(String domain)
Set the
domain for session cookie. |
void |
setExpires(Duration expires)
Set cookie's max age.
|
void |
setHttpOnly(boolean httpOnly)
Set session cookies attribute
HttpOnly . |
void |
setIdName(String idName)
Set the name of the cookie for session id.
|
void |
setPath(String path)
Set the
path for session cookie. |
void |
setSecure(boolean secure)
Set session cookies attribute
Secure . |
public Duration getExpires()
public String getDomain()
domain
.
Define the scope for the cookie.
public String getPath()
path
.
Define the scope of the cookie.
Session should be send for every request. The path
of value "/"
does this.
public String getIdName()
Defaults to: JSESSIONID
public boolean isHttpOnly()
HttpOnly
cookies can only be used when transmitted via HTTP/HTTPS
. They are not accessible for JavaScript
.
Http only cookies have to be supported by the browser.
HttpOnly
public boolean isSecure()
Secure
cookies can only be transmitted over encrypted connection like HTTPS
Secure
public void setExpires(Duration expires)
expires
- the duration after cookie expirespublic void setDomain(String domain)
domain
for session cookie.
Define the scope of the cookie
domain
- a domain to which session cokkie will be attached topublic void setPath(String path)
path
for session cookie.
Define the scope of the cookie.
path
- a path to which session cookie will be attached topublic void setIdName(String idName)
idName
- the name of the cookie for session idpublic void setHttpOnly(boolean httpOnly)
HttpOnly
.httpOnly
- if true client side session cookies are HttpOnly
public void setSecure(boolean secure)
Secure
.secure
- if true client side session cookies can be transmitted only over encrypted connectionpublic SessionCookieConfig expires(Duration expiresDuration)
expiresDuration
- the duration, max age, of the cookies related to session managementpublic SessionCookieConfig domain(String domain)
domain
for session cookie.
Define the scope of the cookie
domain
- a domain to which session cokkie will be attached topublic SessionCookieConfig path(String path)
path
for session cookie.
Define the scope of the cookie.
path
- a path to which session cookie will be attached topublic SessionCookieConfig idName(String idName)
idName
- the name of the cookie for session idpublic SessionCookieConfig httpOnly(boolean httpOnly)
HttpOnly
.httpOnly
- if true client side session cookies are HttpOnly
public SessionCookieConfig secure(boolean secure)
Secure
.secure
- if true client side session cookies can be transmitted only over encrypted connection