Cookies read/write not working in WebView on WinUI
See original GitHub issueDescription
Reading or writing Cookies (see docs) are not working on WinUI.
I think this is because the WebViewRenderer uses the “old” HttpBaseProtocolFilter approach to read/write cookies to the underlying WebView2 control, which does not work.
The new approach should be used: https://github.com/MicrosoftEdge/WebView2Feedback/blob/master/specs/CookieManagement.md
Steps to Reproduce
See https://github.com/dotnet/maui/blob/main/src/Compatibility/Core/src/Windows/WebViewRenderer.cs#L255
Version with bug
Preview 11
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
10.0.19041
Did you find any workaround?
I’m using a custom HybridWebView where I (partially) implemented the new solution. See https://github.com/devsmadeofsteel/Plugin.HybridWebView/pull/17
Relevant log output
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (1 by maintainers)
Top Results From Across the Web
WinUI3 Adding cookie in webview2 not working
I wrote the following code of WinUI 3. This code aims to set a cookie using CoreWebView2.CookieManager.AddOrUpdateCookie(Cookie) but the cookie ...
Read more >How do you clear all cookies before loading a site using ...
It might be caused by the same reason in Cookies read/write not working in WebView on WinUI #3901 For this, you could try...
Read more >Manage user data folders - Microsoft Edge Development
A folder that WebView2 creates to store browser data, such as cookies, permissions, and cached resources. UDF, The user data folder. UDF ...
Read more >Going Native with Blazor
Blazor is welcome on mobile/desktop apps with .NET MAUI, and can pull off some pretty native functionality with platform API access.
Read more >Enable cookies on PhoneGap Android App
i have a problem when running my app on android devices. The cookies are not enabled on the webview (running it on the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I can confirm this issue is still present.
We’ve moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.