org.apache.tomcat.util.http

## Class Cookies

- java.lang.Object
- - org.apache.tomcat.util.http.Cookies

-     public final class Cookies
      extends Object

  A collection of cookies - reusable and tuned for server side performance. Based on RFC2965 ( and 2109 ) This class is not synchronized.
  Author:
    Costin Manolache, kevin seguin

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `INITIAL_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Cookies(MimeHeaders headers)` Construct a new cookie collection, that will extract the information from headers.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ServerCookie` | `getCookie(int idx)`
    `int` | `getCookieCount()`
    `protected void` | `processCookieHeader(byte[] bytes, int off, int len)` Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK
    `void` | `processCookies(MimeHeaders headers)` Add all Cookie found in the headers of a request.
    `void` | `recycle()` Recycle.
    `void` | `setLimit(int limit)`
    `String` | `toString()` EXPENSIVE!!!

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

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

- - ### Field Detail

    - #### INITIAL_SIZE

          public static final int INITIAL_SIZE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Cookies

          public Cookies(MimeHeaders headers)

      Construct a new cookie collection, that will extract the information from headers.
      Parameters:
        `headers` - Cookies are lazy-evaluated and will extract the information from the provided headers.

  - ### Method Detail

    - #### setLimit

          public void setLimit(int limit)

    - #### recycle

          public void recycle()

      Recycle.

    - #### toString

          public String toString()

      EXPENSIVE!!! only for debugging.
      Overrides:
        `toString` in class `Object`

    - #### getCookie

          public ServerCookie getCookie(int idx)

    - #### getCookieCount

          public int getCookieCount()

    - #### processCookies

          public void processCookies(MimeHeaders headers)

      Add all Cookie found in the headers of a request.

    - #### processCookieHeader

          protected final void processCookieHeader(byte[] bytes,
                                 int off,
                                 int len)

      Parses a cookie header after the initial "Cookie:" [WS][$]token[WS]=[WS](token|QV)[;|,] RFC 2965 JVK

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