pub trait ICoreWebView2Cookie: IUnknown {
Show 14 methods
// Required methods
unsafe fn get_name(&self, name: *mut LPWSTR) -> HRESULT;
unsafe fn get_value(&self, value: *mut LPWSTR) -> HRESULT;
unsafe fn put_value(&self, value: LPCWSTR) -> HRESULT;
unsafe fn get_domain(&self, domain: *mut LPWSTR) -> HRESULT;
unsafe fn get_path(&self, path: *mut LPWSTR) -> HRESULT;
unsafe fn get_expires(&self, expires: *mut f64) -> HRESULT;
unsafe fn put_expires(&self, expires: f64) -> HRESULT;
unsafe fn get_is_http_only(&self, is_http_only: *mut BOOL) -> HRESULT;
unsafe fn put_is_http_only(&self, is_http_only: BOOL) -> HRESULT;
unsafe fn get_same_site(
&self,
same_site: *mut CookieSameSiteKind,
) -> HRESULT;
unsafe fn put_same_site(&self, same_site: CookieSameSiteKind) -> HRESULT;
unsafe fn get_is_secure(&self, is_secure: *mut BOOL) -> HRESULT;
unsafe fn put_is_secure(&self, is_secure: BOOL) -> HRESULT;
unsafe fn get_is_session(&self, is_session: *mut BOOL) -> HRESULT;
}Expand description
Provides a set of properties that are used to manage an ICoreWebView2Cookie.
\snippet ScenarioCookieManagement.cpp CookieObject
Required Methods§
Sourceunsafe fn get_domain(&self, domain: *mut LPWSTR) -> HRESULT
unsafe fn get_domain(&self, domain: *mut LPWSTR) -> HRESULT
The domain for which the cookie is valid. The default is the host that this cookie has been received from. Note that, for instance, “.bing.com”, “bing.com”, and “www.bing.com” are considered different domains.
Sourceunsafe fn get_path(&self, path: *mut LPWSTR) -> HRESULT
unsafe fn get_path(&self, path: *mut LPWSTR) -> HRESULT
The path for which the cookie is valid. The default is “/”, which means this cookie will be sent to all pages on the Domain.
Sourceunsafe fn get_expires(&self, expires: *mut f64) -> HRESULT
unsafe fn get_expires(&self, expires: *mut f64) -> HRESULT
The expiration date and time for the cookie as the number of seconds since the UNIX epoch. The default is -1.0, which means cookies are session cookies by default.
Sourceunsafe fn put_expires(&self, expires: f64) -> HRESULT
unsafe fn put_expires(&self, expires: f64) -> HRESULT
Set the Expires property. Cookies are session cookies and will not be persistent if Expires is set to -1.0. NaN, infinity, and any negative value set other than -1.0 is disallowed.
Sourceunsafe fn get_is_http_only(&self, is_http_only: *mut BOOL) -> HRESULT
unsafe fn get_is_http_only(&self, is_http_only: *mut BOOL) -> HRESULT
Whether this cookie is http-only. True if a page script or other active content cannot access this cookie. The default is false.
Sourceunsafe fn put_is_http_only(&self, is_http_only: BOOL) -> HRESULT
unsafe fn put_is_http_only(&self, is_http_only: BOOL) -> HRESULT
Set the IsHttpOnly property.
Sourceunsafe fn get_same_site(&self, same_site: *mut CookieSameSiteKind) -> HRESULT
unsafe fn get_same_site(&self, same_site: *mut CookieSameSiteKind) -> HRESULT
SameSite status of the cookie which represents the enforcement mode of the cookie. The default is COREWEBVIEW2_COOKIE_SAME_SITE_KIND_LAX.
Sourceunsafe fn put_same_site(&self, same_site: CookieSameSiteKind) -> HRESULT
unsafe fn put_same_site(&self, same_site: CookieSameSiteKind) -> HRESULT
Set the SameSite property.
Sourceunsafe fn get_is_secure(&self, is_secure: *mut BOOL) -> HRESULT
unsafe fn get_is_secure(&self, is_secure: *mut BOOL) -> HRESULT
The security level of this cookie. True if the client is only to return the cookie in subsequent requests if those requests use HTTPS. The default is false. Note that cookie that requests COREWEBVIEW2_COOKIE_SAME_SITE_KIND_NONE but is not marked Secure will be rejected.
Sourceunsafe fn put_is_secure(&self, is_secure: BOOL) -> HRESULT
unsafe fn put_is_secure(&self, is_secure: BOOL) -> HRESULT
Set the IsSecure property.
Sourceunsafe fn get_is_session(&self, is_session: *mut BOOL) -> HRESULT
unsafe fn get_is_session(&self, is_session: *mut BOOL) -> HRESULT
Whether this is a session cookie. The default is false.