| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final boolean | |
| private static final int | |
| private static final boolean | |
| private final SessionCookieConfig | |
| private SessionConfig | |
| private final ServletContextImpl |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clearSession(final HttpServerExchange
The exchange exchange, final String The session id sessionId)Implements io. Clears this session from the exchange, removing the attachment and making any changes to the response necessary, such as clearing cookies. |
| public String | findSessionId(final HttpServerExchange
The exchange exchange)Implements io. Retrieves a session id of an existing session from an exchange. |
| public String | getAttribute(final String
Name of attribute to return, case insensitive name)Implements jakarta. Obtain the value for a given session cookie attribute. |
| public Map | getAttributes()
Implements jakarta. Obtain the Map (keys are case insensitive) of all attributes and values, including those set via the attribute specific setters, (excluding version) for this SessionCookieConfig. |
| public String | getComment()
Implements jakarta.
Deprecated
With the adoption of support for RFC 6265, this method should no longer be used. |
| public String | getDomain()
Implements jakarta. Gets the domain name that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. |
| public SessionConfig | |
| public int | getMaxAge()
Implements jakarta. Gets the lifetime (in seconds) of the session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. |
| public String | getName()
Implements jakarta. Gets the name that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. |
| public String | getPath()
Implements jakarta. Gets the path that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. |
| public boolean | isHttpOnly()
Implements jakarta. Checks if the session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired will be marked as HttpOnly. |
| public boolean | isSecure()
Implements jakarta. Checks if the session tracking cookies created on behalf of the application represented by 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. |
| public String | rewriteUrl(final String originalUrl, final String sessionid)
Implements io.
|
| public SessionConfig. | |
| public void | setAttribute(final String
Name of attribute to set, case insensitive name, final String Value of attribute value)Implements jakarta. Sets the value for the given session cookie attribute. |
| public void | setComment(final String
ignore comment)Implements jakarta.
Deprecated
With the adoption of support for RFC 6265, this method should no longer be used. |
| public void | setDomain(final String
the cookie domain to use domain)Implements jakarta. Sets the domain name that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. |
| public void | |
| public void | setHttpOnly(final boolean
true if the session tracking cookies created on behalf of the application represented by the
ServletContext from which this SessionCookieConfig was acquired shall be marked as HttpOnly,
false otherwise httpOnly)Implements jakarta. Marks or unmarks the session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired as HttpOnly. |
| public void | setMaxAge(final int
the lifetime (in seconds) of the session tracking cookies created on behalf of the application
represented by the ServletContext from which this SessionCookieConfig was acquired. maxAge)Implements jakarta. Sets the lifetime (in seconds) for the session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. |
| public void | setName(final String
the cookie name to use name)Implements jakarta. Sets the name that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. |
| public void | setPath(final String
the cookie path to use path)Implements jakarta. Sets the path that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. |
| public void | setSecure(final boolean
true if the session tracking cookies created on behalf of the application represented by 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 secure)Implements jakarta. Marks or unmarks the session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired as secure. |
| public void | setSessionId(final HttpServerExchange
The exchange exchange, final String The session sessionId)Implements io. Attaches the session to the exchange. |
| attributes | back to summary |
|---|---|
| private final Map<String, String> attributes | |
| COOKIE_COMMENT_ATTR | back to summary |
|---|---|
| private static final String COOKIE_COMMENT_ATTR | |
| COOKIE_DOMAIN_ATTR | back to summary |
|---|---|
| private static final String COOKIE_DOMAIN_ATTR | |
| COOKIE_HTTP_ONLY_ATTR | back to summary |
|---|---|
| private static final String COOKIE_HTTP_ONLY_ATTR | |
| COOKIE_MAX_AGE_ATTR | back to summary |
|---|---|
| private static final String COOKIE_MAX_AGE_ATTR | |
| COOKIE_PATH_ATTR | back to summary |
|---|---|
| private static final String COOKIE_PATH_ATTR | |
| COOKIE_SECURE_ATTR | back to summary |
|---|---|
| private static final String COOKIE_SECURE_ATTR | |
| DEFAULT_HTTP_ONLY | back to summary |
|---|---|
| private static final boolean DEFAULT_HTTP_ONLY | |
| DEFAULT_MAX_AGE | back to summary |
|---|---|
| private static final int DEFAULT_MAX_AGE | |
| DEFAULT_SECURE | back to summary |
|---|---|
| private static final boolean DEFAULT_SECURE | |
| delegate | back to summary |
|---|---|
| private final SessionCookieConfig delegate | |
| fallback | back to summary |
|---|---|
| private SessionConfig fallback | |
| servletContext | back to summary |
|---|---|
| private final ServletContextImpl servletContext | |
| SessionCookieConfigImpl | back to summary |
|---|---|
| public SessionCookieConfigImpl(final ServletContextImpl servletContext) | |
| clearSession | back to summary |
|---|---|
| public void clearSession(final HttpServerExchange exchange, final String sessionId) Implements io. Doc from io. Clears this session from the exchange, removing the attachment and making any changes to the response necessary, such as clearing cookies.
| |
| findSessionId | back to summary |
|---|---|
| public String findSessionId(final HttpServerExchange exchange) Implements io. Doc from io. Retrieves a session id of an existing session from an exchange.
| |
| getAttribute | back to summary |
|---|---|
| public String getAttribute(final String name) Implements jakarta. Doc from jakarta. Obtain the value for a given session cookie 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. | |
| getAttributes | back to summary |
|---|---|
| public Map Implements jakarta. Doc from jakarta. Obtain the Map (keys are case insensitive) of all attributes and values, including those set via the attribute specific setters, (excluding version) for this SessionCookieConfig. | |
| getComment | back to summary |
|---|---|
| public String getComment() Implements jakarta. Doc from jakarta. Deprecated
With the adoption of support for RFC 6265, this method should no longer be used.
| |
| getDomain | back to summary |
|---|---|
| public String getDomain() Implements jakarta. Doc from jakarta. Gets the domain name that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. | |
| getFallback | back to summary |
|---|---|
| public SessionConfig getFallback() | |
| getMaxAge | back to summary |
|---|---|
| public int getMaxAge() Implements jakarta. Doc from jakarta. Gets the lifetime (in seconds) of the session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. By default, -1 is returned.
| |
| getName | back to summary |
|---|---|
| public String getName() Implements jakarta. Doc from jakarta. Gets the name that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. By default, JSESSIONID will be used as the cookie name. | |
| getPath | back to summary |
|---|---|
| public String getPath() Implements jakarta. Doc from jakarta. Gets the path that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. By default, the context path of the ServletContext from which this SessionCookieConfig was acquired will be used. | |
| isHttpOnly | back to summary |
|---|---|
| public boolean isHttpOnly() Implements jakarta. Doc from jakarta. Checks if the session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired will be marked as HttpOnly.
| |
| isSecure | back to summary |
|---|---|
| public boolean isSecure() Implements jakarta. Doc from jakarta. Checks if the session tracking cookies created on behalf of the application represented by 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.
| |
| rewriteUrl | back to summary |
|---|---|
| public String rewriteUrl(final String originalUrl, final String sessionid) Implements io.
| |
| sessionCookieSource | back to summary |
|---|---|
| public SessionConfig. Implements io.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(final String name, final String value) Implements jakarta. Doc from jakarta. 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. | |
| setComment | back to summary |
|---|---|
| public void setComment(final String comment) Implements jakarta. Doc from jakarta. Deprecated
With the adoption of support for RFC 6265, this method should no longer be used. If called, this method has no effect.
| |
| setDomain | back to summary |
|---|---|
| public void setDomain(final String domain) Implements jakarta. Doc from jakarta. Sets the domain name that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired.
| |
| setFallback | back to summary |
|---|---|
| public void setFallback(final SessionConfig fallback) | |
| setHttpOnly | back to summary |
|---|---|
| public void setHttpOnly(final boolean httpOnly) Implements jakarta. Doc from jakarta. Marks or unmarks the session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired as HttpOnly. A cookie is marked as HttpOnly by adding the HttpOnly attribute to it. HttpOnly cookies are not supposed to be exposed to client-side scripting code, and may therefore help mitigate certain kinds of cross-site scripting attacks.
| |
| setMaxAge | back to summary |
|---|---|
| public void setMaxAge(final int maxAge) Implements jakarta. Doc from jakarta. Sets the lifetime (in seconds) for the session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired.
| |
| setName | back to summary |
|---|---|
| public void setName(final String name) Implements jakarta. Doc from jakarta. Sets the name that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired. Note Changing the name of session tracking cookies may break other tiers (for example, a load balancing frontend) that assume the cookie name to be equal to the default JSESSIONID, and therefore should only be done cautiously.
| |
| setPath | back to summary |
|---|---|
| public void setPath(final String path) Implements jakarta. Doc from jakarta. Sets the path that will be assigned to any session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired.
| |
| setSecure | back to summary |
|---|---|
| public void setSecure(final boolean secure) Implements jakarta. Doc from jakarta. Marks or unmarks the session tracking cookies created on behalf of the application represented by the ServletContext from which this SessionCookieConfig was acquired as secure. One use case for marking a session tracking cookie as secure, even though the request that initiated the session came over HTTP, is to support a topology where the web container is front-ended by an SSL offloading load balancer. In this case, the traffic between the client and the load balancer will be over HTTPS, whereas the traffic between the load balancer and the web container will be over HTTP.
| |
| setSessionId | back to summary |
|---|---|
| public void setSessionId(final HttpServerExchange exchange, final String sessionId) Implements io. Doc from io. Attaches the session to the exchange. The method should attach the exchange under an attachment key, and should also modify the exchange to allow the session to be re-attached on the next request. Generally this will involve setting a cookie
Once a session has been attached it must be possible to retrieve it via
| |