SessionConfig (Apache Tomcat 11.0.23 API Documentation)
Description: declaration: package: org.apache.tomcat.util.descriptor.web, class: SessionConfig

# Class SessionConfig

java.lang.Object
org.apache.tomcat.util.descriptor.web.SessionConfig

public class SessionConfig extends Object
Representation of a session configuration element for a web application, as represented in a `<session-config>` element in the deployment descriptor.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SessionConfig()`
  Default constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addSessionTrackingMode(String sessionTrackingMode)`
  Adds a session tracking mode.
  `String`
  `getCookieAttribute(String name)`
  Returns a cookie attribute value.
  `Map<String,String>`
  `getCookieAttributes()`
  Returns the cookie attributes map.
  `String`
  `getCookieComment()`
  Returns the cookie comment.
  `String`
  `getCookieDomain()`
  Returns the cookie domain.
  `Boolean`
  `getCookieHttpOnly()`
  Returns the cookie HTTP-only flag.
  `Integer`
  `getCookieMaxAge()`
  Returns the cookie max age.
  `String`
  `getCookieName()`
  Returns the cookie name.
  `String`
  `getCookiePath()`
  Returns the cookie path.
  `Boolean`
  `getCookieSecure()`
  Returns the cookie secure flag.
  `Integer`
  `getSessionTimeout()`
  Returns the session timeout.
  `EnumSet<SessionTrackingMode>`
  `getSessionTrackingModes()`
  Returns the session tracking modes.
  `void`
  `setCookieAttribute(String name, String value)`
  Sets a cookie attribute.
  `void`
  `setCookieComment(String cookieComment)`
  Sets the cookie comment.
  `void`
  `setCookieDomain(String cookieDomain)`
  Sets the cookie domain.
  `void`
  `setCookieHttpOnly(String cookieHttpOnly)`
  Sets the cookie HTTP-only flag.
  `void`
  `setCookieMaxAge(String cookieMaxAge)`
  Sets the cookie max age.
  `void`
  `setCookieName(String cookieName)`
  Sets the cookie name.
  `void`
  `setCookiePath(String cookiePath)`
  Sets the cookie path.
  `void`
  `setCookieSecure(String cookieSecure)`
  Sets the cookie secure flag.
  `void`
  `setSessionTimeout(String sessionTimeout)`
  Sets the session timeout.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SessionConfig

    public SessionConfig()
    Default constructor.

- ## Method Details

  - ### getSessionTimeout

    public Integer getSessionTimeout()
    Returns the session timeout.
    Returns:
      the session timeout

  - ### setSessionTimeout

    public void setSessionTimeout(String sessionTimeout)
    Sets the session timeout.
    Parameters:
      `sessionTimeout` - the session timeout

  - ### getCookieName

    public String getCookieName()
    Returns the cookie name.
    Returns:
      the cookie name

  - ### setCookieName

    public void setCookieName(String cookieName)
    Sets the cookie name.
    Parameters:
      `cookieName` - the cookie name

  - ### getCookieDomain

    public String getCookieDomain()
    Returns the cookie domain.
    Returns:
      the cookie domain

  - ### setCookieDomain

    public void setCookieDomain(String cookieDomain)
    Sets the cookie domain.
    Parameters:
      `cookieDomain` - the cookie domain

  - ### getCookiePath

    public String getCookiePath()
    Returns the cookie path.
    Returns:
      the cookie path

  - ### setCookiePath

    public void setCookiePath(String cookiePath)
    Sets the cookie path.
    Parameters:
      `cookiePath` - the cookie path

  - ### getCookieComment

    public String getCookieComment()
    Returns the cookie comment.
    Returns:
      the cookie comment

  - ### setCookieComment

    public void setCookieComment(String cookieComment)
    Sets the cookie comment.
    Parameters:
      `cookieComment` - the cookie comment

  - ### getCookieHttpOnly

    public Boolean getCookieHttpOnly()
    Returns the cookie HTTP-only flag.
    Returns:
      the HTTP-only flag

  - ### setCookieHttpOnly

    public void setCookieHttpOnly(String cookieHttpOnly)
    Sets the cookie HTTP-only flag.
    Parameters:
      `cookieHttpOnly` - the HTTP-only flag

  - ### getCookieSecure

    public Boolean getCookieSecure()
    Returns the cookie secure flag.
    Returns:
      the secure flag

  - ### setCookieSecure

    public void setCookieSecure(String cookieSecure)
    Sets the cookie secure flag.
    Parameters:
      `cookieSecure` - the secure flag

  - ### getCookieMaxAge

    public Integer getCookieMaxAge()
    Returns the cookie max age.
    Returns:
      the max age

  - ### setCookieMaxAge

    public void setCookieMaxAge(String cookieMaxAge)
    Sets the cookie max age.
    Parameters:
      `cookieMaxAge` - the max age

  - ### getCookieAttributes

    public Map<String,String> getCookieAttributes()
    Returns the cookie attributes map.
    Returns:
      the cookie attributes

  - ### setCookieAttribute

    public void setCookieAttribute(String name, String value)
    Sets a cookie attribute.
    Parameters:
      `name` - the attribute name
      `value` - the attribute value

  - ### getCookieAttribute

    public String getCookieAttribute(String name)
    Returns a cookie attribute value.
    Parameters:
      `name` - the attribute name
    Returns:
      the attribute value

  - ### getSessionTrackingModes

    public EnumSet<SessionTrackingMode> getSessionTrackingModes()
    Returns the session tracking modes.
    Returns:
      the session tracking modes

  - ### addSessionTrackingMode

    public void addSessionTrackingMode(String sessionTrackingMode)
    Adds a session tracking mode.
    Parameters:
      `sessionTrackingMode` - the tracking mode to add