Package org.apache.catalina.core
Class ApplicationSessionCookieConfig
- java.lang.Object
-
- org.apache.catalina.core.ApplicationSessionCookieConfig
-
- All Implemented Interfaces:
SessionCookieConfig
public class ApplicationSessionCookieConfig extends java.lang.Object implements SessionCookieConfig
-
-
Constructor Summary
Constructors Constructor Description ApplicationSessionCookieConfig(StandardContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Cookie
createSessionCookie(Context context, java.lang.String sessionId, boolean secure)
Creates a new session cookie for the given session IDjava.lang.String
getComment()
java.lang.String
getDomain()
int
getMaxAge()
java.lang.String
getName()
java.lang.String
getPath()
boolean
isHttpOnly()
boolean
isSecure()
void
setComment(java.lang.String comment)
Sets the comment for the session cookievoid
setDomain(java.lang.String domain)
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
setName(java.lang.String name)
Sets the session cookie name.void
setPath(java.lang.String path)
Sets the path of the session cookie.void
setSecure(boolean secure)
Sets the secure flag for the session cookie.
-
-
-
Constructor Detail
-
ApplicationSessionCookieConfig
public ApplicationSessionCookieConfig(StandardContext context)
-
-
Method Detail
-
getComment
public java.lang.String getComment()
- Specified by:
getComment
in interfaceSessionCookieConfig
-
getDomain
public java.lang.String getDomain()
- Specified by:
getDomain
in interfaceSessionCookieConfig
-
getMaxAge
public int getMaxAge()
- Specified by:
getMaxAge
in interfaceSessionCookieConfig
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceSessionCookieConfig
-
getPath
public java.lang.String getPath()
- Specified by:
getPath
in interfaceSessionCookieConfig
-
isHttpOnly
public boolean isHttpOnly()
- Specified by:
isHttpOnly
in interfaceSessionCookieConfig
-
isSecure
public boolean isSecure()
- Specified by:
isSecure
in interfaceSessionCookieConfig
-
setComment
public void setComment(java.lang.String comment)
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
public void setDomain(java.lang.String domain)
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
public void setName(java.lang.String name)
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
public void setPath(java.lang.String path)
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
public static Cookie createSessionCookie(Context context, java.lang.String sessionId, boolean secure)
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
-
-