Class ApplicationSessionCookieConfig

    • 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 getAttribute​(java.lang.String name)
      Obtain the value for a sesison cookie given attribute.
      java.util.Map<java.lang.String,​java.lang.String> getAttributes()
      Obtain the Map of attributes and values (excluding version) for this session cookie.
      java.lang.String getComment()
      With the adoption of support for RFC 6265, this method should no longer be used.
      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 setAttribute​(java.lang.String name, java.lang.String value)
      Sets the value for the given session cookie attribute.
      void setComment​(java.lang.String comment)
      If called, this method has no effect.
      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

      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.String value)
        Description copied from interface: jakarta.servlet.SessionCookieConfig
        Sets the value for the given session cookie attribute. When a value is set via this method, the value returned by the attribute specific getter (if any) must be consistent with the value set via this method.
        Specified by:
        setAttribute in interface SessionCookieConfig
        Parameters:
        name - Name of attribute to set
        value - Value of attribute
      • getAttribute

        public java.lang.String getAttribute​(java.lang.String name)
        Description copied from interface: jakarta.servlet.SessionCookieConfig
        Obtain the value for a sesison cookie given attribute. Values returned from this method must be consistent with the values set and returned by the attribute specific getters and setters in this class.
        Specified by:
        getAttribute in interface SessionCookieConfig
        Parameters:
        name - Name of attribute to return
        Returns:
        Value of specified attribute
      • getAttributes

        public java.util.Map<java.lang.String,​java.lang.String> getAttributes()
        Description copied from interface: jakarta.servlet.SessionCookieConfig
        Obtain the Map of attributes and values (excluding version) for this session cookie.
        Specified by:
        getAttributes in interface SessionCookieConfig
        Returns:
        A read-only Map of attributes to values, excluding version.
      • 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