Package org.apache.catalina.core
Class ApplicationSessionCookieConfig
java.lang.Object
org.apache.catalina.core.ApplicationSessionCookieConfig
- All Implemented Interfaces:
SessionCookieConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Cookie
createSessionCookie
(Context context, String sessionId, boolean secure) Creates a new session cookie for the given session IDObtain the comment to use for session cookies.Obtain the domain to use for session cookies.int
Obtain 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.boolean
Will session cookies be created with the httpOnly flag set?boolean
isSecure()
Will session cookies be created with the secure flag set?void
setComment
(String comment) Sets the comment for the session cookievoid
Sets the domain for the session cookievoid
setHttpOnly
(boolean httpOnly) Sets the httpOnly flag for the session cookie.void
setMaxAge
(int maxAge) Sets the maximum age.void
Sets the session cookie name.void
Sets the path of the session cookie.void
setSecure
(boolean secure) Sets the secure flag for the session cookie.
-
Constructor Details
-
ApplicationSessionCookieConfig
-
-
Method Details
-
getComment
Description copied from interface:javax.servlet.SessionCookieConfig
Obtain the comment to use for session cookies.- Specified by:
getComment
in interfaceSessionCookieConfig
- Returns:
- the comment to use for session cookies.
-
getDomain
Description copied from interface:javax.servlet.SessionCookieConfig
Obtain the domain to use for session cookies.- Specified by:
getDomain
in interfaceSessionCookieConfig
- Returns:
- the domain to use for session cookies.
-
getMaxAge
public int getMaxAge()Description copied from interface:javax.servlet.SessionCookieConfig
Obtain the maximum age to set for a session cookie.- Specified by:
getMaxAge
in interfaceSessionCookieConfig
- Returns:
- the maximum age in seconds
-
getName
Description copied from interface:javax.servlet.SessionCookieConfig
Obtain the name to use for the session cookies.- Specified by:
getName
in interfaceSessionCookieConfig
- Returns:
- the name to use for session cookies.
-
getPath
Description copied from interface:javax.servlet.SessionCookieConfig
Obtain the path to use for session cookies. This is normally the context path.- Specified by:
getPath
in interfaceSessionCookieConfig
- Returns:
- The path to use for session cookies.
-
isHttpOnly
public boolean isHttpOnly()Description copied from interface:javax.servlet.SessionCookieConfig
Will session cookies be created with the httpOnly flag set?- Specified by:
isHttpOnly
in interfaceSessionCookieConfig
- Returns:
true
if the flag should be set, otherwisefalse
-
isSecure
public boolean isSecure()Description copied from interface:javax.servlet.SessionCookieConfig
Will session cookies be created with the secure flag set?- Specified by:
isSecure
in interfaceSessionCookieConfig
- Returns:
true
if the flag should be set, otherwisefalse
-
setComment
Description copied from interface:javax.servlet.SessionCookieConfig
Sets the comment for the session cookie- Specified by:
setComment
in interfaceSessionCookieConfig
- Parameters:
comment
- The session cookie comment
-
setDomain
Description copied from interface:javax.servlet.SessionCookieConfig
Sets the domain for the session cookie- Specified by:
setDomain
in interfaceSessionCookieConfig
- Parameters:
domain
- The session cookie domain
-
setHttpOnly
public void setHttpOnly(boolean httpOnly) Description copied from interface:javax.servlet.SessionCookieConfig
Sets the httpOnly flag for the session cookie.- Specified by:
setHttpOnly
in interfaceSessionCookieConfig
- Parameters:
httpOnly
- The httpOnly setting to use for session cookies
-
setMaxAge
public void setMaxAge(int maxAge) Description copied from interface:javax.servlet.SessionCookieConfig
Sets the maximum age.- Specified by:
setMaxAge
in interfaceSessionCookieConfig
- Parameters:
maxAge
- the maximum age to set
-
setName
Description copied from interface:javax.servlet.SessionCookieConfig
Sets the session cookie name.- Specified by:
setName
in interfaceSessionCookieConfig
- Parameters:
name
- The name of the session cookie
-
setPath
Description copied from interface:javax.servlet.SessionCookieConfig
Sets the path of the session cookie.- Specified by:
setPath
in interfaceSessionCookieConfig
- Parameters:
path
- The session cookie path
-
setSecure
public void setSecure(boolean secure) Description copied from interface:javax.servlet.SessionCookieConfig
Sets the secure flag for the session cookie.- Specified by:
setSecure
in interfaceSessionCookieConfig
- Parameters:
secure
- The secure setting to use for session cookies
-
createSessionCookie
Creates a new session cookie for the given session ID- Parameters:
context
- The Context for the web applicationsessionId
- The ID of the session for which the cookie will be createdsecure
- Should session cookie be configured as secure- Returns:
- the cookie for the session
-