Platforms to show: All Mac Windows Linux Cross-Platform

Back to WebView2CookieManagerMBS class.

WebView2CookieManagerMBS.AddOrUpdateCookie(cookie as WebView2CookieMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method WebView2 MBS WinFrameworks Plugin 23.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Adds or updates a cookie with the given cookie data; may overwrite cookies with matching name, domain, and path if they exist.

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

WebView2CookieManagerMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method WebView2 MBS WinFrameworks Plugin 23.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The private constructor.

See also:

WebView2CookieManagerMBS.Constructor(cookie as WebView2CookieMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method WebView2 MBS WinFrameworks Plugin 23.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The copy constructor.

Enables you to make a subclass and then initialize it with an existing cookie manager.

See also:

WebView2CookieManagerMBS.CopyCookie(Cookie as WebView2CookieMBS) as WebView2CookieMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method WebView2 MBS WinFrameworks Plugin 23.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Creates a cookie whose params matches those of the specified cookie.

WebView2CookieManagerMBS.CreateCookie(Name as String, Value as String, Domain as String, Path as String) as WebView2CookieMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method WebView2 MBS WinFrameworks Plugin 23.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Create a cookie object with a specified name, value, domain, and path.

One can set other optional properties after cookie creation. This only creates a cookie object and it is not added to the cookie manager until you call AddOrUpdateCookie. Leading or trailing whitespace(s), empty string, and special characters are not allowed for name. See WebView2CookieMBS class for more details.

WebView2CookieManagerMBS.DeleteAllCookies

Type Topic Plugin Version macOS Windows Linux iOS Targets
method WebView2 MBS WinFrameworks Plugin 23.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Deletes all cookies under the same profile.

This could affect other WebViews under the same user profile.

WebView2CookieManagerMBS.DeleteCookie(cookie as WebView2CookieMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method WebView2 MBS WinFrameworks Plugin 23.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Deletes a cookie whose name and domain/path pair match those of the specified cookie.

WebView2CookieManagerMBS.DeleteCookies(Name as String, URI as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method WebView2 MBS WinFrameworks Plugin 23.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Deletes cookies with matching name and uri.

Cookie name is required. All cookies with the given name where domain and path match provided URI are deleted.

WebView2CookieManagerMBS.DeleteCookiesWithDomainAndPath(Name as String, Domain as string, Path as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method WebView2 MBS WinFrameworks Plugin 23.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Deletes cookies with matching name and domain/path pair.

Cookie name is required. If domain is specified, deletes only cookies with the exact domain. If path is specified, deletes only cookies with the exact path.

WebView2CookieManagerMBS.GetCookies(URI as String = "")

Type Topic Plugin Version macOS Windows Linux iOS Targets
method WebView2 MBS WinFrameworks Plugin 23.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Gets a list of cookies matching the specific URI.

If uri is empty string or null, all cookies under the same profile are returned. You can modify the cookie objects by calling AddOrUpdateCookie, and the changes will be applied to the webview.

Calls GotCookies event later.

WebView2CookieManagerMBS.GetCookiesSync(URI as String = "") as WebView2CookieMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method WebView2 MBS WinFrameworks Plugin 23.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Gets a list of cookies matching the specific URI.
Example

dim web as WebView2ControlMBS // your control
Dim cookiemanager As WebView2CookieManagerMBS = web.CookieManager

// get all cookies synchronously
Dim cookies() As WebView2CookieMBS = cookiemanager.GetCookiesSync

If uri is empty string or null, all cookies under the same profile are returned. You can modify the cookie objects by calling AddOrUpdateCookie, and the changes will be applied to the webview.

This is the synchronous version, where we wait for cookies.

Some examples using this method:

The items on this page are in the following plugins: MBS WinFrameworks Plugin.


The biggest plugin in space...