Android Programming Press on the image to return to the main documentation page.

CookieManager

Written by Martin Pearman

CookieManager is a simple wrapper for the Android
CookieManager and
CookieSyncManager Classes. It
enables you to manages the cookies used by your application's WebView
instances.

List of types:

CookieManager
CookieSyncManager

CookieManager


Events:

None

Members:


  GetAcceptCookies As Boolean

  GetAllowFileSchemeCookies As Boolean

  GetCookie (Url As String) As String

  HasCookies As Boolean

  RemoveAllCookies

  RemoveExpiredCookies

  RemoveSessionCookies

  SetAcceptCookies (Accept As Boolean)

  SetAcceptFileSchemeCookies (Accept As Boolean)

  SetCookie (Url As String, Value As String)

Members description:

GetAcceptCookies As Boolean
Returns True if cookies will be accepted by your application.
GetAllowFileSchemeCookies As Boolean
Gets whether the application's WebView instances send and accept cookies for file scheme URLs.
GetCookie (Url As String) As String
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 As Boolean
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 As Boolean)
Set whether cookies will be accepted for your application.
SetAcceptFileSchemeCookies (Accept As Boolean)
Sets whether the application's WebView instances should send and accept cookies for file scheme URLs.
SetCookie (Url As String, Value As String)
Sets the cookie for the Url to the Value.

CookieSyncManager


Events:

None

Members:


  CreateInstance

  ResetSync

  StartSync

  StopSync

  Sync

Members description:

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.
Top