How to get, set, or delete browser cookies?

Starting in v4.0, 3D WebView has a cross-platform Web.CookieManager API that applications can use to get, set, and delete cookies on most platforms.

The Web.CookieManager is supported by all of the 3D WebView packages except for the following:

For these packages that don't support the CookieManager API, an alternative is to use ExecuteJavaScript() to access document.cookie for the current page, like this:

var cookies = await webViewPrefab.WebView.ExecuteJavaScript("document.cookie");

Please note that for 2D WebView for WebGL, ExecuteJavaScript() can only be used if the URL loaded in the webview has the same domain as the Unity WebGL app's URL, like described here.