Freigeben über


CookieManager.SetAcceptThirdPartyCookies(WebView, Boolean) Method

Definition

Sets whether the WebView should allow third party cookies to be set.

[Android.Runtime.Register("setAcceptThirdPartyCookies", "(Landroid/webkit/WebView;Z)V", "GetSetAcceptThirdPartyCookies_Landroid_webkit_WebView_ZHandler")]
public abstract void SetAcceptThirdPartyCookies (Android.Webkit.WebView? webview, bool accept);
[<Android.Runtime.Register("setAcceptThirdPartyCookies", "(Landroid/webkit/WebView;Z)V", "GetSetAcceptThirdPartyCookies_Landroid_webkit_WebView_ZHandler")>]
abstract member SetAcceptThirdPartyCookies : Android.Webkit.WebView * bool -> unit

Parameters

webview
WebView

the WebView instance to set the cookie policy on

accept
Boolean

whether the WebView instance should accept third party cookies

Attributes

Remarks

Sets whether the WebView should allow third party cookies to be set. Allowing third party cookies is a per WebView policy and can be set differently on different WebView instances.

Apps that target android.os.Build.VERSION_CODES#KITKAT or below default to allowing third party cookies. Apps targeting android.os.Build.VERSION_CODES#LOLLIPOP or later default to disallowing third party cookies.

Java documentation for android.webkit.CookieManager.setAcceptThirdPartyCookies(android.webkit.WebView, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to