# LocalCookieStore (Crawler-commons 0.7 API)
Date: 2016-11-21

crawlercommons.fetcher.http

## Class LocalCookieStore

- java.lang.Object
- - crawlercommons.fetcher.http.LocalCookieStore

All Implemented Interfaces:
  Serializable, org.apache.http.client.CookieStore

Deprecated.
As of release 0.6. We recommend directly using Apache HttpClient, async-http-client, or any other robust, industrial-strength HTTP clients.

    @Deprecated
     @NotThreadSafe
    public class LocalCookieStore
    extends Object
    implements org.apache.http.client.CookieStore, Serializable

Default implementation of `CookieStore` Initially copied from HttpComponents Changes: removed synchronization

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`LocalCookieStore()` Deprecated.

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`void` `addCookie(org.apache.http.cookie.Cookie cookie)` Deprecated. Adds an `HTTP cookie`, replacing any existing equivalent cookies.
`void` `addCookies(org.apache.http.cookie.Cookie[] cookies)` Deprecated. Adds an array of `HTTP cookies`.
`void` `clear()` Deprecated. Clears all cookies.
`boolean` `clearExpired(Date date)` Deprecated. Removes all of `cookies` in this HTTP state that have expired by the specified `date`.
`List<org.apache.http.cookie.Cookie>` `getCookies()` Deprecated. Returns an immutable array of `cookies` that this HTTP state currently contains.
`String` `toString()` Deprecated.

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

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

### Constructor Detail

#### LocalCookieStore

    public LocalCookieStore()

Deprecated.

### Method Detail

#### addCookie

    public void addCookie(org.apache.http.cookie.Cookie cookie)

Deprecated.
Adds an `HTTP cookie`, replacing any existing equivalent cookies. If the given ookie has already expired it will not be added, but existing values will still be removed.

Specified by:
  `addCookie` in interface `org.apache.http.client.CookieStore`
Parameters:
  `cookie` - the `cookie` to be added
See Also:
  `addCookies(Cookie[])`

#### addCookies

    public void addCookies(org.apache.http.cookie.Cookie[] cookies)

Deprecated.
Adds an array of `HTTP cookies`. Cookies are added individually and in the given array order. If any of the given cookies has already expired it will not be added, but existing values will still be removed.

Parameters:
  `cookies` - the `cookies` to be added
See Also:
  `addCookie(Cookie)`

#### getCookies

    public List<org.apache.http.cookie.Cookie> getCookies()

Deprecated.
Returns an immutable array of `cookies` that this HTTP state currently contains.

Specified by:
  `getCookies` in interface `org.apache.http.client.CookieStore`
Returns:
  an array of `cookies`.

#### clearExpired

    public boolean clearExpired(Date date)

Deprecated.
Removes all of `cookies` in this HTTP state that have expired by the specified `date`.

Specified by:
  `clearExpired` in interface `org.apache.http.client.CookieStore`
Returns:
  true if any cookies were purged.
See Also:
  `Cookie.isExpired(Date)`

#### clear

    public void clear()

Deprecated.
Clears all cookies.

Specified by:
  `clear` in interface `org.apache.http.client.CookieStore`

#### toString

    public String toString()

Deprecated.

Overrides:
  `toString` in class `Object`