Skip to content

Webview Desktop - CookieManager is not used by the actual webview #395

@threethan

Description

@threethan

The cookie manager accessible through WebViewState.cookieManager() is not the same one used by the web view itself.

  • It is possible to read and write persistent cookies using WebViewState.cookieManager(), but they won't be used by the WebView
  • The WebView can read and write cookies, but they won't be accessible through WebViewState.cookieManager() and will not persist

This means that cookies cannot be read or written as expected on desktop ( #152 )

Explanation:

  • WebViewState.cookieManager() is backed by CefCookieManager.getGlobalManager() which stores cookies only for CefRequestContext.getGlobalContext() [DesktopCookieManager.kt]
  • WebView.defaultWebViewFactory(param) uses a custom CefRequestContext ("createModifiedRequestContext") which differs from the global one [WebView.desktop.kt] [CefRequestExt.kt]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions