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 ID
    `java.lang.String` | `getComment()` | Obtain the comment to use for session cookies.
    `java.lang.String` | `getDomain()` | Obtain the domain to use for session cookies.
    `int` | `getMaxAge()` | Obtain the maximum age to set for a session cookie.
    `java.lang.String` | `getName()` | Obtain the name to use for the session cookies.
    `java.lang.String` | `getPath()` | Obtain the path to use for session cookies.
    `boolean` | `isHttpOnly()` | Will session cookies be created with the httpOnly flag set?
    `boolean` | `isSecure()` | Will session cookies be created with the secure flag set?
    `void` | `setComment​(java.lang.String comment)` | Sets the comment for the session cookie
    `void` | `setDomain​(java.lang.String domain)` | Sets the domain for the session cookie
    `void` | `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.

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### ApplicationSessionCookieConfig

          public ApplicationSessionCookieConfig​(StandardContext context)

  - ### Method Detail

    - #### getComment

          public java.lang.String getComment()

      Description copied from interface: `javax.servlet.SessionCookieConfig`
      Obtain the comment to use for session cookies.
      Specified by:
        `getComment` in interface `SessionCookieConfig`
      Returns:
        the comment to use for session cookies.

    - #### getDomain

          public java.lang.String getDomain()

      Description copied from interface: `javax.servlet.SessionCookieConfig`
      Obtain the domain to use for session cookies.
      Specified by:
        `getDomain` in interface `SessionCookieConfig`
      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 interface `SessionCookieConfig`
      Returns:
        the maximum age in seconds

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `javax.servlet.SessionCookieConfig`
      Obtain the name to use for the session cookies.
      Specified by:
        `getName` in interface `SessionCookieConfig`
      Returns:
        the name to use for session cookies.

    - #### getPath

          public java.lang.String 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 interface `SessionCookieConfig`
      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 interface `SessionCookieConfig`
      Returns:
        `true` if the flag should be set, otherwise `false`

    - #### 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 interface `SessionCookieConfig`
      Returns:
        `true` if the flag should be set, otherwise `false`

    - #### 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 interface `SessionCookieConfig`
      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 interface `SessionCookieConfig`
      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 interface `SessionCookieConfig`
      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 interface `SessionCookieConfig`
      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 interface `SessionCookieConfig`
      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 interface `SessionCookieConfig`
      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 interface `SessionCookieConfig`
      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 application
        `sessionId` - The ID of the session for which the cookie will be created
        `secure` - Should session cookie be configured as secure
      Returns:
        the cookie for the session