public class

BasicCookieStore

extends Object
implements Serializable CookieStore
java.lang.Object
   ↳ org.apache.http.impl.client.BasicCookieStore

Class Overview

Default implementation of CookieStore

Summary

Public Constructors
BasicCookieStore()
Public Methods
synchronized void addCookie(Cookie cookie)
Adds an HTTP cookie, replacing any existing equivalent cookies.
synchronized void addCookies(Cookie[] cookies)
Adds an array of HTTP cookies.
synchronized void clear()
Clears all cookies.
synchronized boolean clearExpired(Date date)
Removes all of cookies in this HTTP state that have expired by the specified date.
synchronized List<Cookie> getCookies()
Returns an immutable array of cookies that this HTTP state currently contains.
synchronized String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.client.CookieStore

Public Constructors

public BasicCookieStore ()

Also: HttpClient

Public Methods

public synchronized void addCookie (Cookie cookie)

Also: HttpClient

Adds an HTTP 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

public synchronized void addCookies (Cookie[] cookies)

Also: HttpClient

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

public synchronized void clear ()

Also: HttpClient

Clears all cookies.

public synchronized boolean clearExpired (Date date)

Also: HttpClient

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

Returns
  • true if any cookies were purged.
See Also

public synchronized List<Cookie> getCookies ()

Also: HttpClient

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

Returns

public synchronized String toString ()