Package ratpack.session
Class SessionCookieConfig
- java.lang.Object
- 
- ratpack.session.SessionCookieConfig
 
- 
 public class SessionCookieConfig extends Object Basic configuration for cookies related to session management.Attributes are shared with ClientSideSessionConfigthat is used by client side session (cookie based).- See Also:
- ClientSideSessionConfig
 
- 
- 
Constructor SummaryConstructors Constructor Description SessionCookieConfig()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionCookieConfigdomain(String domain)Set thedomainfor session cookie.SessionCookieConfigexpires(Duration expiresDuration)Set max age of the cookies related to session management.StringgetDomain()Use the session cookie only when requesting from thedomain.DurationgetExpires()Cookie's max age.StringgetIdName()The name of the cookie for session id.StringgetPath()Use the session cookie only when requesting from thepath.SessionCookieConfighttpOnly(boolean httpOnly)Set session cookies attributeHttpOnly.SessionCookieConfigidName(String idName)Set the name of the cookie for session id.booleanisHttpOnly()HttpOnlycookies can only be used when transmitted viaHTTP/HTTPS.booleanisSecure()Securecookies can only be transmitted over encrypted connection likeHTTPS.SessionCookieConfigpath(String path)Set thepathfor session cookie.SessionCookieConfigsecure(boolean secure)Set session cookies attributeSecure.voidsetDomain(String domain)Set thedomainfor session cookie.voidsetExpires(Duration expires)Set cookie's max age.voidsetHttpOnly(boolean httpOnly)Set session cookies attributeHttpOnly.voidsetIdName(String idName)Set the name of the cookie for session id.voidsetPath(String path)Set thepathfor session cookie.voidsetSecure(boolean secure)Set session cookies attributeSecure.
 
- 
- 
- 
Method Detail- 
getExpirespublic Duration getExpires() Cookie's max age.- Returns:
- the max age of the session related cookies
 
 - 
getDomainpublic String getDomain() Use the session cookie only when requesting from thedomain.Define the scope for the cookie. - Returns:
- the URI domain to which session cookie will be attached to.
 
 - 
getPathpublic String getPath() Use the session cookie only when requesting from thepath.Define the scope of the cookie. Session should be send for every request. The pathof value"/"does this.- Returns:
- the URI path to which session cookie will be attached to.
 
 - 
getIdNamepublic String getIdName() The name of the cookie for session id.Defaults to: JSESSIONID- Returns:
- the name of the cookie for session id
 
 - 
isHttpOnlypublic boolean isHttpOnly() HttpOnlycookies can only be used when transmitted viaHTTP/HTTPS. They are not accessible forJavaScript.Http only cookies have to be supported by the browser. - Returns:
- true if client side session cookies are HttpOnly
 
 - 
isSecurepublic boolean isSecure() Securecookies can only be transmitted over encrypted connection likeHTTPS.- Returns:
- true if session cookies are Secure
 
 - 
setExpirespublic void setExpires(Duration expires) Set cookie's max age.- Parameters:
- expires- the duration after cookie expires
 
 - 
setDomainpublic void setDomain(String domain) Set thedomainfor session cookie.Define the scope of the cookie - Parameters:
- domain- a domain to which session cokkie will be attached to
 
 - 
setPathpublic void setPath(String path) Set thepathfor session cookie.Define the scope of the cookie. - Parameters:
- path- a path to which session cookie will be attached to
 
 - 
setIdNamepublic void setIdName(String idName) Set the name of the cookie for session id.- Parameters:
- idName- the name of the cookie for session id
 
 - 
setHttpOnlypublic void setHttpOnly(boolean httpOnly) Set session cookies attributeHttpOnly.- Parameters:
- httpOnly- if true client side session cookies are- HttpOnly
 
 - 
setSecurepublic void setSecure(boolean secure) Set session cookies attributeSecure.- Parameters:
- secure- if true client side session cookies can be transmitted only over encrypted connection
 
 - 
expirespublic SessionCookieConfig expires(Duration expiresDuration) Set max age of the cookies related to session management.- Parameters:
- expiresDuration- the duration, max age, of the cookies related to session management
- Returns:
- the config
 
 - 
domainpublic SessionCookieConfig domain(String domain) Set thedomainfor session cookie.Define the scope of the cookie - Parameters:
- domain- a domain to which session cokkie will be attached to
- Returns:
- the config
 
 - 
pathpublic SessionCookieConfig path(String path) Set thepathfor session cookie.Define the scope of the cookie. - Parameters:
- path- a path to which session cookie will be attached to
- Returns:
- the config
 
 - 
idNamepublic SessionCookieConfig idName(String idName) Set the name of the cookie for session id.- Parameters:
- idName- the name of the cookie for session id
- Returns:
- the config
 
 - 
httpOnlypublic SessionCookieConfig httpOnly(boolean httpOnly) Set session cookies attributeHttpOnly.- Parameters:
- httpOnly- if true client side session cookies are- HttpOnly
- Returns:
- the config
 
 - 
securepublic SessionCookieConfig secure(boolean secure) Set session cookies attributeSecure.- Parameters:
- secure- if true client side session cookies can be transmitted only over encrypted connection
- Returns:
- the config
 
 
- 
 
-