Partilhar via


CoreWebView2CookieManager.AddOrUpdateCookie(CoreWebView2Cookie) Method

Definition

Adds or updates a cookie with the given cookie data; may overwrite cookies with matching name, domain, and path if they exist.

public void AddOrUpdateCookie (Microsoft.Web.WebView2.Core.CoreWebView2Cookie cookie);
member this.AddOrUpdateCookie : Microsoft.Web.WebView2.Core.CoreWebView2Cookie -> unit
Public Sub AddOrUpdateCookie (cookie As CoreWebView2Cookie)

Parameters

cookie
CoreWebView2Cookie

The CoreWebView2Cookie to be added or updated.

Examples

CoreWebView2Cookie cookie = _iWebView2.CoreWebView2.CookieManager.CreateCookie("CookieName", "CookieValue", ".bing.com", "/");
_iWebView2.CoreWebView2.CookieManager.AddOrUpdateCookie(cookie);

Remarks

This method will fail if the domain of the given cookie is not specified.

Applies to