Package javax.servlet
Interface SessionCookieConfig
public interface SessionCookieConfig
Configures the session cookies used by the web application associated with the ServletContext from which this
 SessionCookieConfig was obtained.
- Since:
- Servlet 3.0
- 
Method SummaryModifier and TypeMethodDescriptionObtain the comment to use for session cookies.Obtain the domain to use for session cookies.intObtain the maximum age to set for a session cookie.getName()Obtain the name to use for the session cookies.getPath()Obtain the path to use for session cookies.booleanWill session cookies be created with the httpOnly flag set?booleanisSecure()Will session cookies be created with the secure flag set?voidsetComment(String comment) Sets the comment for the session cookievoidSets the domain for the session cookievoidsetHttpOnly(boolean httpOnly) Sets the httpOnly flag for the session cookie.voidsetMaxAge(int MaxAge) Sets the maximum age.voidSets the session cookie name.voidSets the path of the session cookie.voidsetSecure(boolean secure) Sets the secure flag for the session cookie.
- 
Method Details- 
setNameSets the session cookie name.- Parameters:
- name- The name of the session cookie
- Throws:
- IllegalStateException- if the associated ServletContext has already been initialised
 
- 
getNameString getName()Obtain the name to use for the session cookies.- Returns:
- the name to use for session cookies.
 
- 
setDomainSets the domain for the session cookie- Parameters:
- domain- The session cookie domain
- Throws:
- IllegalStateException- if the associated ServletContext has already been initialised
 
- 
getDomainString getDomain()Obtain the domain to use for session cookies.- Returns:
- the domain to use for session cookies.
 
- 
setPathSets the path of the session cookie.- Parameters:
- path- The session cookie path
- Throws:
- IllegalStateException- if the associated ServletContext has already been initialised
 
- 
getPathString getPath()Obtain the path to use for session cookies. This is normally the context path.- Returns:
- The path to use for session cookies.
 
- 
setCommentSets the comment for the session cookie- Parameters:
- comment- The session cookie comment
- Throws:
- IllegalStateException- if the associated ServletContext has already been initialised
 
- 
getCommentString getComment()Obtain the comment to use for session cookies.- Returns:
- the comment to use for session cookies.
 
- 
setHttpOnlyvoid setHttpOnly(boolean httpOnly) Sets the httpOnly flag for the session cookie.- Parameters:
- httpOnly- The httpOnly setting to use for session cookies
- Throws:
- IllegalStateException- if the associated ServletContext has already been initialised
 
- 
isHttpOnlyboolean isHttpOnly()Will session cookies be created with the httpOnly flag set?- Returns:
- trueif the flag should be set, otherwise- false
 
- 
setSecurevoid setSecure(boolean secure) Sets the secure flag for the session cookie.- Parameters:
- secure- The secure setting to use for session cookies
- Throws:
- IllegalStateException- if the associated ServletContext has already been initialised
 
- 
isSecureboolean isSecure()Will session cookies be created with the secure flag set?- Returns:
- trueif the flag should be set, otherwise- false
 
- 
setMaxAgevoid setMaxAge(int MaxAge) Sets the maximum age.- Parameters:
- MaxAge- the maximum age to set
- Throws:
- IllegalStateException- if the associated ServletContext has already been initialised
 
- 
getMaxAgeint getMaxAge()Obtain the maximum age to set for a session cookie.- Returns:
- the maximum age in seconds
 
 
-