putCookie

fun putCookie(uri: String, cookie: Cookie)

Stores or updates cookie for uri in the desktop WebView cookie store.

uri must be an absolute http:// or https:// URI with a host. When cookie does not contain domain or path, the native bridge derives them from uri. Existing cookies are updated only when the native cookie key matches: name, domain, and path. Cookies with the same name but a different domain or path can coexist.

Platform notes:

PlatformNative operationKey behavior
WindowsWebView2 AddOrUpdateCookieAdds or updates a cookie in the current WebView2 profile.
LinuxWebKitGTK webkit_cookie_manager_add_cookieAdds through WebKitGTK/libsoup storage; matching cookie keys are replaced by the underlying store.
macOSWKHTTPCookieStore.setCookieStores the cookie in the WebKit website data store for this WebView configuration.