CookieManager is a simple wrapper for the Android
CookieManager|http
://developer.android.com/reference/android/webkit/
CookieManager.html and
CookieSyncManager|http://developer.android
.com/reference/android/webkit/CookieSyncManager.html Classes. It
enables you to manages the cookies used by your application's WebView
instances.
CookieManager
Methods:
GetAcceptCookies AsBoolean Returns True if cookies will be accepted by your application.
GetAllowFileSchemeCookies AsBoolean Gets whether the application's WebView instances send and accept cookies for file scheme URLs.
GetCookie (Url AsString)AsString Returns the cookie for the given Url in the format: NAME=VALUE [; NAME=VALUE]
If no cookie exists for the Url then a null value will be returned.
HasCookies AsBoolean Returns True if any cookies are stored for your application.
RemoveAllCookies Removes all cookies stored for your application.
RemoveExpiredCookies Removes all expired cookies stored for your application.
RemoveSessionCookies Removes all session cookies stored for your application.
SetAcceptCookies (Accept AsBoolean)
Set whether cookies will be accepted for your application.
SetAcceptFileSchemeCookies (Accept AsBoolean)
Sets whether the application's WebView instances should send and accept cookies for file scheme URLs.
SetCookie (Url AsString, Value AsString)
Sets the cookie for the Url to the Value.
CookieSyncManager
Methods:
CreateInstance Creates an instance of the CookieSyncManager.
The CookieSyncManager is used to synchronise the browser cookie store between RAM and permanent storage.
To get the best performance, browser cookies are saved in RAM.
A separate thread saves the cookies between, driven by a timer with a 5 minute interval.
ResetSync Resets the CookieSyncManager timer.
StartSync Requests the CookieSyncManager to start synchronisation.
Typically called in Activity_Resume.
StopSync Requests the CookieSyncManager to stop synchronisation.
Typically called in Activity_Pause.
Sync Forces the CookieSyncManager to synchronise now.
This method is asynchronous, there is no guarantee it will synchronise immediately.