org.apache.catalina.core

## Class ApplicationSessionCookieConfig

- java.lang.Object
- - org.apache.catalina.core.ApplicationSessionCookieConfig

- All Implemented Interfaces:
    SessionCookieConfig

      public class ApplicationSessionCookieConfig
      extends Object
      implements SessionCookieConfig

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ApplicationSessionCookieConfig(StandardContext context)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Cookie` | `createSessionCookie(Context context, String sessionId, boolean secure)` Creates a new session cookie for the given session ID
    `String` | `getComment()`
    `String` | `getDomain()`
    `int` | `getMaxAge()`
    `String` | `getName()`
    `String` | `getPath()`
    `boolean` | `isHttpOnly()`
    `boolean` | `isSecure()`
    `void` | `setComment(String comment)` Sets the comment for the session cookie
    `void` | `setDomain(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(String name)` Sets the session cookie name.
    `void` | `setPath(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 String getComment()

      Specified by:
        `getComment` in interface `SessionCookieConfig`

    - #### getDomain

          public String getDomain()

      Specified by:
        `getDomain` in interface `SessionCookieConfig`

    - #### getMaxAge

          public int getMaxAge()

      Specified by:
        `getMaxAge` in interface `SessionCookieConfig`

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `SessionCookieConfig`

    - #### getPath

          public String getPath()

      Specified by:
        `getPath` in interface `SessionCookieConfig`

    - #### isHttpOnly

          public boolean isHttpOnly()

      Specified by:
        `isHttpOnly` in interface `SessionCookieConfig`

    - #### isSecure

          public boolean isSecure()

      Specified by:
        `isSecure` in interface `SessionCookieConfig`

    - #### setComment

          public void setComment(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(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(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(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,
                                   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

Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.