
The CookieProcessor element represents the component that
parses received cookie headers into javax.servlet.http.Cookie
objects accessible through HttpServletRequest.getCookies() and
converts javax.servlet.http.Cookie objects added to the response
through HttpServletResponse.addCookie() to the HTTP headers
returned to the client.
A CookieProcessor element MAY be nested inside a Context component. If it is not included, a default implementation will be created automatically.
All implementations of CookieProcessor support the following attributes:
| Attribute | Description |
|---|---|
className |
Java class name of the implementation to use. This class must
implement the |
The standard implementation of CookieProcessor is
org.apache.tomcat.util.http.Rfc6265CookieProcessor.
This cookie processor is based on RFC6265 with the following changes to support better interoperability:
The RFC 6265 cookie processor is generally more lenient than the legacy cookie parser. In particular:
=' and '/' characters are always
permitted in a cookie value.The RFC 6265 Cookie Processor supports the following additional attributes.
| Attribute | Description |
|---|---|
cookiesWithoutEquals |
Determines how a cookie received from a user agent should be
interpreted when the name value pair does not contain an equals sign.
The default value is |
partitioned |
Should the Partitioned flag be set on cookies? Defaults to Note: The name of the attribute used to indicate a partitioned cookie as part of CHIPS is not defined by an RFC and may change in a non-backwards compatible way once equivalent functionality is included in an RFC. |
sameSiteCookies |
Enables setting same-site cookie attribute. If value is If value is If value is If value is |
This is the legacy cookie parser based on RFC6265, RFC2109 and RFC2616. It implements a strict interpretation of the cookie specifications. Due to various interoperability issues with browsers not all strict behaviours are enabled by default and additional options are available to further relax the behaviour of this cookie processor if required.
| Attribute | Description |
|---|---|
allowEqualsInValue |
If this is If not set the specification compliant default value of
|
allowHttpSepsInV0 |
If this is If not specified, the default specification compliant value of
|
allowNameOnly |
If this is If not set the specification compliant default value of
|
alwaysAddExpires |
If this is If |
forwardSlashIsSeparator |
If this is |
sameSiteCookies |
Enables setting same-site cookie attribute. If value is If value is If value is If value is |
No element may be nested inside a CookieProcessor.
No special features are associated with a CookieProcessor element.