Package org.apache.tomcat.util.http
Class CookieProcessorBase
java.lang.Object
org.apache.tomcat.util.http.CookieProcessorBase
- All Implemented Interfaces:
- CookieProcessor
- Direct Known Subclasses:
- LegacyCookieProcessor,- Rfc6265CookieProcessor
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final ThreadLocal<DateFormat>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongenerateHeader(Cookie cookie, HttpServletRequest request) Deprecated.booleanShould thePartitionedattribute be added by default to cookies created for this web application.voidsetPartitioned(boolean partitioned) Configure whether thePartitionedattribute should be added by default to cookies created for this web application.voidsetSameSiteCookies(String sameSiteCookies) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.tomcat.util.http.CookieProcessorgenerateHeader, getCharset, parseCookieHeader
- 
Field Details- 
COOKIE_DATE_FORMAT
- 
ANCIENT_DATE
 
- 
- 
Constructor Details- 
CookieProcessorBasepublic CookieProcessorBase()
 
- 
- 
Method Details- 
getSameSiteCookies
- 
setSameSiteCookies
- 
getPartitionedpublic boolean getPartitioned()Should thePartitionedattribute be added by default to cookies created for this web application.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. - Returns:
- trueif the- Partitionedattribute should be added by default to cookies created for this web application, otherwise- false
 
- 
setPartitionedpublic void setPartitioned(boolean partitioned) Configure whether thePartitionedattribute should be added by default to cookies created for this web application.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. - Parameters:
- partitioned-- trueif the- Partitionedattribute should be added by default to cookies created for this web application, otherwise- false
 
- 
generateHeaderDeprecated.This implementation calls the deprecatedCookieProcessor.generateHeader(Cookie)method. Implementors should not rely on this method as it is present only for transitional compatibility and will be removed in Tomcat 9.Generate theSet-CookieHTTP 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.- Specified by:
- generateHeaderin interface- CookieProcessor
- Parameters:
- cookie- The cookie for which the header will be generated
- request- The servlet request
- Returns:
- The header value in a form that can be added directly to the response
 
 
- 
CookieProcessor.generateHeader(Cookie)method.