ICoreWebView2CookieManager

Undocumented in source.

Members

Functions

AddOrUpdateCookie
HRESULT AddOrUpdateCookie(ICoreWebView2Cookie cookie)

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. \snippet ScenarioCookieManagement.cpp AddOrUpdateCookie

CopyCookie
HRESULT CopyCookie(ICoreWebView2Cookie cookieParam, ICoreWebView2Cookie* cookie)

Creates a cookie whose params matches those of the specified cookie.

CreateCookie
HRESULT CreateCookie(LPCWSTR name, LPCWSTR value, LPCWSTR domain, LPCWSTR path, ICoreWebView2Cookie* cookie)

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 ICoreWebView2Cookie for more details.

DeleteAllCookies
HRESULT DeleteAllCookies()

Deletes all cookies under the same profile. This could affect other WebViews under the same user profile.

DeleteCookie
HRESULT DeleteCookie(ICoreWebView2Cookie cookie)

Deletes a cookie whose name and domain/path pair match those of the specified cookie.

DeleteCookies
HRESULT DeleteCookies(LPCWSTR name, LPCWSTR uri)

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.

DeleteCookiesWithDomainAndPath
HRESULT DeleteCookiesWithDomainAndPath(LPCWSTR name, LPCWSTR domain, LPCWSTR path)

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.

GetCookies
HRESULT GetCookies(LPCWSTR uri, ICoreWebView2GetCookiesCompletedHandler handler)

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 ICoreWebView2CookieManager::AddOrUpdateCookie, and the changes will be applied to the webview. \snippet ScenarioCookieManagement.cpp GetCookies

Meta