public final class LegacyCookieProcessor extends CookieProcessorBase
ANCIENT_DATE, COOKIE_DATE_FORMAT
Constructor and Description |
---|
LegacyCookieProcessor() |
Modifier and Type | Method and Description |
---|---|
String |
generateHeader(Cookie cookie)
Generate the
Set-Cookie HTTP header value for the given Cookie. |
String |
generateHeader(Cookie cookie,
HttpServletRequest request)
Generate the
Set-Cookie HTTP header value for the given Cookie. |
boolean |
getAllowEqualsInValue() |
boolean |
getAllowHttpSepsInV0() |
boolean |
getAllowNameOnly() |
boolean |
getAlwaysAddExpires() |
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.
|
boolean |
getForwardSlashIsSeparator() |
void |
parseCookieHeader(MimeHeaders headers,
ServerCookies serverCookies)
Parse the provided headers into server cookie objects.
|
void |
setAllowEqualsInValue(boolean allowEqualsInValue) |
void |
setAllowHttpSepsInV0(boolean allowHttpSepsInV0) |
void |
setAllowNameOnly(boolean allowNameOnly) |
void |
setAlwaysAddExpires(boolean alwaysAddExpires) |
void |
setForwardSlashIsSeparator(boolean forwardSlashIsSeparator) |
getSameSiteCookies, setSameSiteCookies
public boolean getAllowEqualsInValue()
public void setAllowEqualsInValue(boolean allowEqualsInValue)
public boolean getAllowNameOnly()
public void setAllowNameOnly(boolean allowNameOnly)
public boolean getAllowHttpSepsInV0()
public void setAllowHttpSepsInV0(boolean allowHttpSepsInV0)
public boolean getForwardSlashIsSeparator()
public void setForwardSlashIsSeparator(boolean forwardSlashIsSeparator)
public boolean getAlwaysAddExpires()
public void setAlwaysAddExpires(boolean alwaysAddExpires)
public Charset getCharset()
CookieProcessor
public void parseCookieHeader(MimeHeaders headers, ServerCookies serverCookies)
CookieProcessor
headers
- The HTTP headers to parseserverCookies
- The server cookies object to populate with the
results of the parsingpublic String generateHeader(Cookie cookie)
CookieProcessor
Set-Cookie
HTTP header value for the given Cookie.cookie
- The cookie for which the header will be generatedpublic String generateHeader(Cookie cookie, HttpServletRequest request)
CookieProcessorBase
Set-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.generateHeader
in interface CookieProcessor
generateHeader
in class CookieProcessorBase
cookie
- The cookie for which the header will be generatedrequest
- The servlet requestCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.