org.apache.hc.client5.http.cookie

## Interface CookieStore

- All Known Implementing Classes:
    BasicCookieStore

      public interface CookieStore

  This interface represents an abstract store for `Cookie` objects.
  Since:
    4.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCookie(Cookie cookie)` Adds an `Cookie`, replacing any existing equivalent cookies.
    `void` | `clear()` Clears all cookies.
    `boolean` | `clearExpired(Date date)` Deprecated. Use `clearExpired(Instant)`
    `default boolean` | `clearExpired(Instant date)` Removes all of `Cookie`s in this store that have expired by the specified `Instant`.
    `List<Cookie>` | `getCookies()` Returns all cookies contained in this store.

- - ### Method Detail

    - #### addCookie

          void addCookie(Cookie cookie)

      Adds an `Cookie`, replacing any existing equivalent cookies. If the given cookie has already expired it will not be added, but existing values will still be removed.
      Parameters:
        `cookie` - the `cookie` to be added

    - #### getCookies

          List<Cookie> getCookies()

      Returns all cookies contained in this store.
      Returns:
        all cookies

    - #### clearExpired

          @Deprecated
          boolean clearExpired(Date date)

      Deprecated. Use `clearExpired(Instant)`
      Removes all of `Cookie`s in this store that have expired by the specified `Date`.
      Returns:
        true if any cookies were purged.

    - #### clearExpired

          default boolean clearExpired(Instant date)

      Removes all of `Cookie`s in this store that have expired by the specified `Instant`.
      Returns:
        true if any cookies were purged.

    - #### clear

          void clear()

      Clears all cookies.

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.