public abstract class CookieStore extends Object
WebView instances.| 构造器 | 说明 |
|---|---|
CookieStore() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
abstract String |
getCookie(String url) |
Obtains the cookie of the specified URL.
|
static CookieStore |
getInstance() |
Obtains a singleton instance of
CookieStore. |
abstract boolean |
hasCookies() |
Checks whether cookies exist.
|
abstract boolean |
isCookieEnable() |
Checks whether cookies are enabled.
|
abstract boolean |
isCrossDomainCookieEnable(WebView webView) |
Checks whether cross-domain cookies are enabled in a specified
WebView object. |
abstract void |
persist() |
Saves cookies to the device's persistent storage.
|
abstract void |
removeCookies(boolean isSessionCookiesOnly,
AsyncCallback<Boolean> callback) |
Removes session cookies or all cookies.
|
abstract void |
setCookie(String url,
String value) |
Sets a cookie for the specified URL.
|
abstract void |
setCookieEnable(boolean isEnable) |
Sets whether to enable cookies.
|
abstract void |
setCrossDomainCookieEnable(WebView webView,
boolean isEnable) |
Sets whether to enable cross-domain cookies in a specified
WebView object. |
public abstract void setCookieEnable(boolean isEnable)
isEnable - Specifies whether to enable cookies. The value true means to enable cookies, and
false means the opposite.public abstract void removeCookies(boolean isSessionCookiesOnly,
AsyncCallback<Boolean> callback)
isSessionCookiesOnly - Specifies whether to remove only session cookies. The value true indicates
that only session cookies will be removed, and false indicates that all cookies will be removed.callback - Indicates the callback object to be invoked to receive the asynchronous result.public abstract String getCookie(String url)
url - Indicates the specified URL.public abstract void persist()
public abstract void setCookie(String url, String value)
url - Indicates the specified URL.value - Indicates the cookie to set.public abstract void setCrossDomainCookieEnable(WebView webView, boolean isEnable)
WebView object.webView - Indicates the WebView instance.isEnable - Specifies whether to enable cross-domain cookies in the specified WebView object. The
value true means to enable cross-domain cookies, and false means the opposite.public abstract boolean isCookieEnable()
true if cookies are enabled; returns false otherwise.public abstract boolean isCrossDomainCookieEnable(WebView webView)
WebView object.webView - Indicates the WebView instance.true if cross-domain cookies are enabled; returns false otherwise.public abstract boolean hasCookies()
true if cookies exist; returns false otherwise.public static CookieStore getInstance()
CookieStore.CookieStore instance.