Android.Webkit.CookieSyncManager Class
The CookieSyncManager is used to synchronize the browser cookie store between RAM and permanent storage.

See Also: CookieSyncManager Members

Syntax

[Android.Runtime.Register("android/webkit/CookieSyncManager", DoNotGenerateAcw=true)]
[System.Obsolete("This class is obsoleted in this android platform")]
public sealed class CookieSyncManager : WebSyncManager

Remarks

The CookieSyncManager is used to synchronize 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.

To use the CookieSyncManager, the host application has to call the following when the application starts:

java Example

CookieSyncManager.createInstance(context)

To set up for sync, the host application has to call

java Example

CookieSyncManager.getInstance().startSync()

in Activity.onResume(), and call

java Example

 CookieSyncManager.getInstance().stopSync()
 

in Activity.onPause().

To get instant sync instead of waiting for the timer to trigger, the host can call

java Example

CookieSyncManager.getInstance().sync()

The sync interval is 5 minutes, so you will want to force syncs manually anyway, for instance in WebViewClient.OnPageFinished(WebView, System.String). Note that even sync() happens asynchronously, so don't do it just as your activity is shutting down.

[Android Documentation]

Requirements

Namespace: Android.Webkit
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1