CookieManager will call CookieStore.add to save cookies
for every incoming HTTP response, and call CookieStore.get to
retrieve cookie for every outgoing HTTP request. A CookieStore
is responsible for removing HttpCookie instances which have expired.
| Modifier and Type | Method and Description |
|---|---|
| public void | add(URI
the uri this cookie associated with.
if uri, HttpCookie null, this cookie will not be associated
with an URIthe cookie to store cookie)Adds one HTTP cookie to the store. |
| public List | |
| public List | Returns: an immutable list of http cookies; return empty list if there's no http cookie in storeGet all not-expired cookies in cookie store. |
| public List | Returns: an immutable list of URIs; return empty list if no cookie in this cookie store is associated with an URIGet all URIs which identify the cookies in this cookie store. |
| public boolean | Returns: true if this store contained the specified cookiethe uri this cookie associated with.
if uri, HttpCookie null, the cookie to be removed is not associated
with an URI when added; if not null, the cookie
to be removed is associated with the given URI when added.the cookie to remove cookie)Remove a cookie from store. |
| public boolean | Returns: true if this store changed as a result of the callRemove all cookies in this cookie store. |
| add | back to summary |
|---|---|
| public void add(URI uri, HttpCookie cookie) Adds one HTTP cookie to the store. This is called for every incoming HTTP response. A cookie to store may or may not be associated with an URI. If it is not associated with an URI, the cookie's domain and path attribute will indicate where it comes from. If it is associated with an URI and its domain and path attribute are not specified, given URI will indicate where this cookie comes from. If a cookie corresponding to the given URI already exists, then it is replaced with the new one.
| |
| get | back to summary |
|---|---|
| public List Retrieve cookies associated with given URI, or whose domain matches the given URI. Only cookies that have not expired are returned. This is called for every outgoing HTTP request.
| |
| getCookies | back to summary |
|---|---|
| public List Get all not-expired cookies in cookie store.
| |
| getURIs | back to summary |
|---|---|
| public List Get all URIs which identify the cookies in this cookie store. | |
| remove | back to summary |
|---|---|
| public boolean remove(URI uri, HttpCookie cookie) Remove a cookie from store.
| |
| removeAll | back to summary |
|---|---|
| public boolean removeAll() Remove all cookies in this cookie store.
| |