Package org.glassfish.grizzly.servlet
Class SessionCookieConfig
java.lang.Object
org.glassfish.grizzly.servlet.SessionCookieConfig
- All Implemented Interfaces:
jakarta.servlet.SessionCookieConfig
Class that may be used to configure various properties of cookies used for session tracking purposes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name) Deprecated.intgetName()getPath()booleanbooleanisSecure()voidsetAttribute(String name, String value) voidsetComment(String comment) Deprecated.voidvoidsetHttpOnly(boolean httpOnly) voidsetMaxAge(int maxAge) voidvoidvoidsetSecure(boolean secure)
-
Constructor Details
-
SessionCookieConfig
Constructor
-
-
Method Details
-
setName
- Specified by:
setNamein interfacejakarta.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
- Specified by:
getNamein interfacejakarta.servlet.SessionCookieConfig- Returns:
- the cookie name set via
setName(java.lang.String), or JSESSIONID ifsetName(java.lang.String)was never called
-
setDomain
- Specified by:
setDomainin interfacejakarta.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
- Specified by:
getDomainin interfacejakarta.servlet.SessionCookieConfig- Returns:
- the cookie domain set via
setDomain(java.lang.String), or null ifsetDomain(java.lang.String)was never called
-
setPath
- Specified by:
setPathin interfacejakarta.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
- Specified by:
getPathin interfacejakarta.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 ifsetPath(java.lang.String)was never called
-
setComment
Deprecated.- Specified by:
setCommentin interfacejakarta.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
Deprecated.- Specified by:
getCommentin interfacejakarta.servlet.SessionCookieConfig- Returns:
- the cookie comment set via
setComment(java.lang.String), or null ifsetComment(java.lang.String)was never called
-
setHttpOnly
public void setHttpOnly(boolean httpOnly) - Specified by:
setHttpOnlyin interfacejakarta.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:
isHttpOnlyin interfacejakarta.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:
setSecurein interfacejakarta.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:
isSecurein interfacejakarta.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:
setMaxAgein interfacejakarta.servlet.SessionCookieConfig
-
getMaxAge
public int getMaxAge()- Specified by:
getMaxAgein interfacejakarta.servlet.SessionCookieConfig
-
setAttribute
- Specified by:
setAttributein interfacejakarta.servlet.SessionCookieConfig
-
getAttribute
- Specified by:
getAttributein interfacejakarta.servlet.SessionCookieConfig
-
getAttributes
- Specified by:
getAttributesin interfacejakarta.servlet.SessionCookieConfig
-