Class SessionCookieConfig

java.lang.Object
org.glassfish.grizzly.servlet.SessionCookieConfig
All Implemented Interfaces:
javax.servlet.SessionCookieConfig

public class SessionCookieConfig extends Object implements javax.servlet.SessionCookieConfig
Class that may be used to configure various properties of cookies used for session tracking purposes.
  • Constructor Details

    • SessionCookieConfig

      public SessionCookieConfig(WebappContext ctx)
      Constructor
  • Method Details

    • setName

      public void setName(String name)
      Specified by:
      setName in interface javax.servlet.SessionCookieConfig
      Parameters:
      name - the cookie name to use
      Throws:
      IllegalStateException - if the ServletContext from which this SessionCookieConfig was acquired has already been initialized
    • getName

      public String getName()
      Specified by:
      getName in interface javax.servlet.SessionCookieConfig
      Returns:
      the cookie name set via setName(java.lang.String), or JSESSIONID if setName(java.lang.String) was never called
    • setDomain

      public void setDomain(String domain)
      Specified by:
      setDomain in interface javax.servlet.SessionCookieConfig
      Parameters:
      domain - the cookie domain to use
      Throws:
      IllegalStateException - if the ServletContext from which this SessionCookieConfig was acquired has already been initialized
    • getDomain

      public String getDomain()
      Specified by:
      getDomain in interface javax.servlet.SessionCookieConfig
      Returns:
      the cookie domain set via setDomain(java.lang.String), or null if setDomain(java.lang.String) was never called
    • setPath

      public void setPath(String path)
      Specified by:
      setPath in interface javax.servlet.SessionCookieConfig
      Parameters:
      path - the cookie path to use
      Throws:
      IllegalStateException - if the ServletContext from which this SessionCookieConfig was acquired has already been initialized
    • getPath

      public String getPath()
      Specified by:
      getPath in interface javax.servlet.SessionCookieConfig
      Returns:
      the cookie path set via setPath(java.lang.String), or the context path of the ServletContext from which this SessionCookieConfig was acquired if setPath(java.lang.String) was never called
    • setComment

      public void setComment(String comment)
      Specified by:
      setComment in interface javax.servlet.SessionCookieConfig
      Parameters:
      comment - the cookie comment to use
      Throws:
      IllegalStateException - if the ServletContext from which this SessionCookieConfig was acquired has already been initialized
    • getComment

      public String getComment()
      Specified by:
      getComment in interface javax.servlet.SessionCookieConfig
      Returns:
      the cookie comment set via setComment(java.lang.String), or null if setComment(java.lang.String) was never called
    • setHttpOnly

      public void setHttpOnly(boolean httpOnly)
      Specified by:
      setHttpOnly in interface javax.servlet.SessionCookieConfig
      Parameters:
      httpOnly - true if the session tracking cookies created on behalf of the ServletContext from which this SessionCookieConfig was acquired shall be marked as HttpOnly, false otherwise
      Throws:
      IllegalStateException - if the ServletContext from which this SessionCookieConfig was acquired has already been initialized
    • isHttpOnly

      public boolean isHttpOnly()
      Specified by:
      isHttpOnly in interface javax.servlet.SessionCookieConfig
      Returns:
      true if the session tracking cookies created on behalf of the ServletContext from which this SessionCookieConfig was acquired will be marked as HttpOnly, false otherwise
    • setSecure

      public void setSecure(boolean secure)
      Specified by:
      setSecure in interface javax.servlet.SessionCookieConfig
      Parameters:
      secure - true if the session tracking cookies created on behalf of the ServletContext from which this SessionCookieConfig was acquired shall be marked as secure even if the request that initiated the corresponding session is using plain HTTP instead of HTTPS, and false if they shall be marked as secure only if the request that initiated the corresponding session was also secure
      Throws:
      IllegalStateException - if the ServletContext from which this SessionCookieConfig was acquired has already been initialized
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface javax.servlet.SessionCookieConfig
      Returns:
      true if the session tracking cookies created on behalf of the ServletContext from which this SessionCookieConfig was acquired will be marked as secure even if the request that initiated the corresponding session is using plain HTTP instead of HTTPS, and false if they will be marked as secure only if the request that initiated the corresponding session was also secure
    • setMaxAge

      public void setMaxAge(int maxAge)
      Specified by:
      setMaxAge in interface javax.servlet.SessionCookieConfig
    • getMaxAge

      public int getMaxAge()
      Specified by:
      getMaxAge in interface javax.servlet.SessionCookieConfig