Package org.apache.tomcat.util.http
Class LegacyCookieProcessor
- java.lang.Object
- 
- org.apache.tomcat.util.http.CookieProcessorBase
- 
- org.apache.tomcat.util.http.LegacyCookieProcessor
 
 
- 
- All Implemented Interfaces:
- CookieProcessor
 
 public final class LegacyCookieProcessor extends CookieProcessorBase The legacy (up to early Tomcat 8 releases) cookie parser based on RFC6265, RFC2109 and RFC2616. This class is not thread-safe.- Author:
- Costin Manolache, kevin seguin
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tomcat.util.http.CookieProcessorBaseANCIENT_DATE, COOKIE_DATE_FORMAT
 
- 
 - 
Constructor SummaryConstructors Constructor Description LegacyCookieProcessor()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgenerateHeader(Cookie cookie)Generate theSet-CookieHTTP header value for the given Cookie.java.lang.StringgenerateHeader(Cookie cookie, HttpServletRequest request)Generate theSet-CookieHTTP header value for the given Cookie.booleangetAllowEqualsInValue()booleangetAllowHttpSepsInV0()booleangetAllowNameOnly()booleangetAlwaysAddExpires()java.nio.charset.CharsetgetCharset()Obtain the character set that will be used when converting between bytes and characters when parsing and/or generating HTTP headers for cookies.booleangetForwardSlashIsSeparator()voidparseCookieHeader(MimeHeaders headers, ServerCookies serverCookies)Parse the provided headers into server cookie objects.voidsetAllowEqualsInValue(boolean allowEqualsInValue)voidsetAllowHttpSepsInV0(boolean allowHttpSepsInV0)voidsetAllowNameOnly(boolean allowNameOnly)voidsetAlwaysAddExpires(boolean alwaysAddExpires)voidsetForwardSlashIsSeparator(boolean forwardSlashIsSeparator)- 
Methods inherited from class org.apache.tomcat.util.http.CookieProcessorBasegetSameSiteCookies, setSameSiteCookies
 
- 
 
- 
- 
- 
Method Detail- 
getAllowEqualsInValuepublic boolean getAllowEqualsInValue() 
 - 
setAllowEqualsInValuepublic void setAllowEqualsInValue(boolean allowEqualsInValue) 
 - 
getAllowNameOnlypublic boolean getAllowNameOnly() 
 - 
setAllowNameOnlypublic void setAllowNameOnly(boolean allowNameOnly) 
 - 
getAllowHttpSepsInV0public boolean getAllowHttpSepsInV0() 
 - 
setAllowHttpSepsInV0public void setAllowHttpSepsInV0(boolean allowHttpSepsInV0) 
 - 
getForwardSlashIsSeparatorpublic boolean getForwardSlashIsSeparator() 
 - 
setForwardSlashIsSeparatorpublic void setForwardSlashIsSeparator(boolean forwardSlashIsSeparator) 
 - 
getAlwaysAddExpirespublic boolean getAlwaysAddExpires() 
 - 
setAlwaysAddExpirespublic void setAlwaysAddExpires(boolean alwaysAddExpires) 
 - 
getCharsetpublic java.nio.charset.Charset getCharset() Description copied from interface:CookieProcessorObtain the character set that will be used when converting between bytes and characters when parsing and/or generating HTTP headers for cookies.- Returns:
- The character set used for byte<->character conversions
 
 - 
parseCookieHeaderpublic void parseCookieHeader(MimeHeaders headers, ServerCookies serverCookies) Description copied from interface:CookieProcessorParse the provided headers into server cookie objects.- Parameters:
- headers- The HTTP headers to parse
- serverCookies- The server cookies object to populate with the results of the parsing
 
 - 
generateHeaderpublic java.lang.String generateHeader(Cookie cookie) Description copied from interface:CookieProcessorGenerate theSet-CookieHTTP header value for the given Cookie.- Parameters:
- cookie- The cookie for which the header will be generated
- Returns:
- The header value in a form that can be added directly to the response
 
 - 
generateHeaderpublic java.lang.String generateHeader(Cookie cookie, HttpServletRequest request) Description copied from class:CookieProcessorBaseGenerate 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
- Overrides:
- generateHeaderin class- CookieProcessorBase
- 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
 
 
- 
 
-