CookieAccessFilter will cause cookie not sent in some requests
-
What version of the product are you using?
- What version are you using? Nuget 86.0.241, 95.7.141, 100.0.23 (latest one)
- Issue is reproducible for all the CefSharp versions
-
What architecture x86 or x64? I tested it in x64, but I think it doesn't matter
-
On what operating system?
- Win7, Win 8, Win10, etc? I tested it in Win 10, but I think it doesn't matter
-
Are you using
WinForms,WPForOffScreen? WPF -
What steps will reproduce the problem?
- Please provide detailed information here, enough for someone else to reproduce your problem.
- open the url
https://mstra.rjrpub.com/MicroStrategyLibrary/?loginMode=1048576in cefsharp browser - if the cookie filter is set, it will show an error page
- More info is under https://github.com/andrewzjl/CefSharpCookieFilterIssue Same change is done in the forked branch https://github.com/andrewzjl/CefSharp.MinimalExample/tree/CefSharpCookieFilterIssue
-
What is the expected output? What do you see instead? It should be the same as the cookieFilter not set, if the cookieFilter.CanSentCookie return true
-
Please provide any additional information below.
- A stack trace if available, any Exception information. No Exception, but the cookie is not sent
- Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory) No
- Any other background information that's relevant? Are you doing something out of the ordinary? 3rd party controls? I don't know why the cookie is missed, but it happens
You are welcome to review the code, I suspect this is a bug in CEF.
- https://github.com/cefsharp/CefSharp/blob/a4a6fb20c7f7186c17d435535703f427a290450f/CefSharp.Core.Runtime/Internals/CefResourceRequestHandlerAdapter.h#L86
- https://github.com/cefsharp/CefSharp/blob/d350cad52ab1a49e2c60d62357387a409729dc9f/CefSharp.Core.Runtime/Internals/CefCookieAccessFilterAdapter.h#L42
I think adding a unit test or two to validate the wrapper has been implemented correctly is the way to go from a CefSharp point of view. CEF has some tests we can use as a base
https://github.com/chromiumembedded/cef/blob/a7bbd8a62bfc91b0d53eeef8d07b64a5ed719a5f/tests/ceftests/cookie_unittest.cc#L1439