Platforms to show: All Mac Windows Linux Cross-Platform
Back to WebView2CookieManagerMBS class.
WebView2CookieManagerMBS.AddOrUpdateCookie(cookie as WebView2CookieMBS)
Function:
Adds or updates a cookie with the given cookie data; may overwrite cookies with matching name, domain, and path if they exist.
Notes: This method will fail if the domain of the given cookie is not specified.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | WebView2 | MBS WinFrameworks Plugin | 23.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: This method will fail if the domain of the given cookie is not specified.
WebView2CookieManagerMBS.Constructor Private
Function:
The private constructor.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | WebView2 | MBS WinFrameworks Plugin | 23.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
See also:
WebView2CookieManagerMBS.Constructor(cookie as WebView2CookieMBS)
Function:
The copy constructor.
Notes: Enables you to make a subclass and then initialize it with an existing cookie manager.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | WebView2 | MBS WinFrameworks Plugin | 23.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: Enables you to make a subclass and then initialize it with an existing cookie manager.
See also:
WebView2CookieManagerMBS.CopyCookie(Cookie as WebView2CookieMBS) as WebView2CookieMBS
Function:
Creates a cookie whose params matches those of the specified cookie.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | WebView2 | MBS WinFrameworks Plugin | 23.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
WebView2CookieManagerMBS.CreateCookie(Name as String, Value as String, Domain as String, Path as String) as WebView2CookieMBS
Function:
Create a cookie object with a specified name, value, domain, and path.
Notes: 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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | WebView2 | MBS WinFrameworks Plugin | 23.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: 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
Function:
Deletes all cookies under the same profile.
Notes: This could affect other WebViews under the same user profile.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | WebView2 | MBS WinFrameworks Plugin | 23.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: This could affect other WebViews under the same user profile.
WebView2CookieManagerMBS.DeleteCookie(cookie as WebView2CookieMBS)
Function:
Deletes a cookie whose name and domain/path pair match those of the specified cookie.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | WebView2 | MBS WinFrameworks Plugin | 23.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
WebView2CookieManagerMBS.DeleteCookies(Name as String, URI as string)
Function:
Deletes cookies with matching name and uri.
Notes: Cookie name is required. All cookies with the given name where domain and path match provided URI are deleted.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | WebView2 | MBS WinFrameworks Plugin | 23.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: 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)
Function:
Deletes cookies with matching name and domain/path pair.
Notes: 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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | WebView2 | MBS WinFrameworks Plugin | 23.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes: 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 = "")
Function:
Gets a list of cookies matching the specific URI.
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | WebView2 | MBS WinFrameworks Plugin | 23.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Notes:
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()
Function:
Gets a list of cookies matching the specific URI.
Example:
Notes:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | WebView2 | MBS WinFrameworks Plugin | 23.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
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.
