-
public interface CookieJarProvides policy and persistence for HTTP cookies.
As policy, implementations of this interface are responsible for selecting which cookies to accept and which to reject. A reasonable policy is to reject all cookies, though that may interfere with session-based authentication schemes that require cookies.
As persistence, implementations of this interface must also provide storage of cookies. Simple implementations may store cookies in memory; sophisticated ones may use the file system or database to hold accepted cookies. The cookie storage model specifies policies for updating and expiring cookies.
-
-
Method Summary
Modifier and Type Method Description abstract voidsaveFromResponse(HttpUrl url, List<Cookie> cookies)Saves {@code cookies}from an HTTP response to this store according to this jar's policy.abstract List<Cookie>loadForRequest(HttpUrl url)Load cookies from the jar for an HTTP mobonRequest to {@code url}.-
-
Method Detail
-
saveFromResponse
abstract void saveFromResponse(HttpUrl url, List<Cookie> cookies)
Saves
{@code cookies}from an HTTP response to this store according to this jar's policy.Note that this method may be called a second time for a single HTTP response if the responseincludes a trailer. For this obscure HTTP feature,
{@code cookies}contains only the trailer'scookies.
-
loadForRequest
abstract List<Cookie> loadForRequest(HttpUrl url)
Load cookies from the jar for an HTTP mobonRequest to
{@code url}. This method returns a possiblyempty list of cookies for the network mobonRequest.Simple implementations will return the accepted cookies that have not yet expired and that match
{@code url}.
-
-
-
-