public class Rfc6265CookieProcessor extends CookieProcessorBase
ANCIENT_DATE, COOKIE_DATE_FORMAT| Constructor and Description |
|---|
Rfc6265CookieProcessor() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
generateHeader(Cookie cookie)
Generate the
Set-Cookie HTTP header value for the given Cookie. |
java.lang.String |
generateHeader(Cookie cookie,
HttpServletRequest request)
Generate the
Set-Cookie HTTP header value for the given Cookie. |
java.nio.charset.Charset |
getCharset()
Obtain the character set that will be used when converting between bytes and characters when parsing and/or
generating HTTP headers for cookies.
|
void |
parseCookieHeader(MimeHeaders headers,
ServerCookies serverCookies)
Parse the provided headers into server cookie objects.
|
getPartitioned, getSameSiteCookies, setPartitioned, setSameSiteCookiespublic java.nio.charset.Charset getCharset()
CookieProcessorpublic void parseCookieHeader(MimeHeaders headers, ServerCookies serverCookies)
CookieProcessorheaders - The HTTP headers to parseserverCookies - The server cookies object to populate with the results of the parsingpublic java.lang.String generateHeader(Cookie cookie)
CookieProcessorSet-Cookie HTTP header value for the given Cookie.cookie - The cookie for which the header will be generatedpublic java.lang.String generateHeader(Cookie cookie, HttpServletRequest request)
CookieProcessorSet-Cookie HTTP header value for the given Cookie. This method receives as parameter the
servlet request so that it can make decisions based on request properties. One such use-case is decide if the
SameSite attribute should be added to the cookie based on the User-Agent or other request header because there
are browser versions incompatible with the SameSite attribute. This is described by
the Chromium project.
The default implementation calls the deprecated CookieProcessor.generateHeader(Cookie) method. Implementors should not
rely on this default method as it is present only for transitional compatibility and will be removed in Tomcat 10
at the same time as the CookieProcessor.generateHeader(Cookie) method.
cookie - The cookie for which the header will be generatedrequest - The servlet requestCopyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.