LegacyCookieProcessor (Apache Tomcat 8.5.53 API Documentation)

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.CookieProcessorBase

      `ANCIENT_DATE, COOKIE_DATE_FORMAT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LegacyCookieProcessor()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `generateHeader(Cookie cookie)` 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)`

    - ### Methods inherited from class org.apache.tomcat.util.http.CookieProcessorBase

      `getSameSiteCookies, setSameSiteCookies`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LegacyCookieProcessor

          public LegacyCookieProcessor()

  - ### Method Detail

    - #### getAllowEqualsInValue

          public boolean getAllowEqualsInValue()

    - #### setAllowEqualsInValue

          public void setAllowEqualsInValue(boolean allowEqualsInValue)

    - #### getAllowNameOnly

          public boolean getAllowNameOnly()

    - #### setAllowNameOnly

          public void setAllowNameOnly(boolean allowNameOnly)

    - #### getAllowHttpSepsInV0

          public boolean getAllowHttpSepsInV0()

    - #### setAllowHttpSepsInV0

          public void setAllowHttpSepsInV0(boolean allowHttpSepsInV0)

    - #### getForwardSlashIsSeparator

          public boolean getForwardSlashIsSeparator()

    - #### setForwardSlashIsSeparator

          public void setForwardSlashIsSeparator(boolean forwardSlashIsSeparator)

    - #### getAlwaysAddExpires

          public boolean getAlwaysAddExpires()

    - #### setAlwaysAddExpires

          public void setAlwaysAddExpires(boolean alwaysAddExpires)

    - #### getCharset

          public Charset getCharset()

      Description copied from interface: `CookieProcessor`
      Obtain 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

    - #### parseCookieHeader

          public void parseCookieHeader(MimeHeaders headers,
                               ServerCookies serverCookies)

      Description copied from interface: `CookieProcessor`
      Parse 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

    - #### generateHeader

          public String generateHeader(Cookie cookie)

      Description copied from interface: `CookieProcessor`
      Generate the `Set-Cookie` HTTP 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

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.