Top Description Methods
org.apache.hc.client5.http.cookie

public Interface CookieStore

Known Direct Implementers
org.apache.hc.client5.http.cookie.BasicCookieStore
Imports
java.time.Instant, java.util.Date, .List

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

Method Summary

Modifier and TypeMethod and Description
public void
addCookie(Cookie
the cookie to be added
cookie
)

Adds an Cookie, replacing any existing equivalent cookies.

public void
clear()

Clears all cookies.

public boolean

Returns:

true if any cookies were purged.
clearExpired
(Date date)

Deprecated Use clearExpired(Instant)
Removes all of Cookies in this store that have expired by the specified java.util.Date.
public default boolean

Returns:

true if any cookies were purged.
clearExpired
(Instant date)

Removes all of Cookies in this store that have expired by the specified Instant.

public List<Cookie>

Returns:

all cookies
getCookies
()

Returns all cookies contained in this store.

Method Detail

addCookieback to summary
public 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:Cookie

the cookie to be added

clearback to summary
public void clear()

Clears all cookies.

clearExpiredback to summary
public boolean clearExpired(Date date)

Deprecated

Use clearExpired(Instant)

Removes all of Cookies in this store that have expired by the specified java.util.Date.

Returns:boolean

true if any cookies were purged.

Annotations
@Deprecated
clearExpiredback to summary
public default boolean clearExpired(Instant date)

Removes all of Cookies in this store that have expired by the specified Instant.

Returns:boolean

true if any cookies were purged.

Annotations
@SuppressWarnings:deprecation
getCookiesback to summary
public List<Cookie> getCookies()

Returns all cookies contained in this store.

Returns:List<Cookie>

all cookies