You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v126.x (Chrome bootstrap) unable to load cookies from prior version (Alloy bootstrap) #4847
I have searched both open/closed issues, no issue already exists.
CefSharp Version
126.2.70
Operating System
Windows 11
Architecture
x64
.Net Version
net 8.0
Implementation
WinForms
Reproduction Steps
Initialize CEF with a clean CachePath on a prior version of CefSharp.WinForms.NETCore (e.g. I have tested various versions from 100.0.140-125.0.210) and either create a cookie manually or visit a site that sets a cookie.
update to 126.2.70 and using the same CachePath the cookie is no longer available.
Expected behavior
I would have expected that the cookie created in a prior version to still be available. I have just tested the process of upgrading the following versions and each time the cookies were still intact in the next version until I hit v126.2.70.
100.0.140 -> 119.1.20
119.1.20 -> 120.1.80
120.1.80 -> 123.0.60
123.0.60 -> 124.3.80
124.3.80 -> 125.0.210
125.0.210 -> 126.2.70 *no cookies
Actual behavior
no cookies appear to be in the cookie store immediately after upgrading to v126.2.70
Regression?
yes this looks like it worked in prior versions. it appears at least since 100.0.140 the cookies have been forward compatible until we reached v126.2.70
Thanks for the prompt reply, settings.ChromeRuntime = false; does appear to fix the issue with cookies still being loadable after the update. I'll try to dig deeper into the root cause.
Thanks for the prompt reply, settings.ChromeRuntime = false; does appear to fix the issue with cookies still being loadable after the update. I'll try to dig deeper into the root cause.
I had a similar problem, the point is that when we use chrome bootstrap(ChromeRuntume = true, since 125 ver.) cookies are encrypted with a key that is stored in the Local State file, but if we use alloy bootstrap cookies are encrypted with a key from LocalPrefs.json
Thanks for the prompt reply, settings.ChromeRuntime = false; does appear to fix the issue with cookies still being loadable after the update. I'll try to dig deeper into the root cause.
changed the title [-]v126.x unable to load cookies from prior version[/-][+]v126.x (Chrome bootstrap) unable to load cookies from prior version (Alloy bootstrap)[/+]on Jun 24, 2024
I thought about trying to auto detect the first run with the Chrome bootstrap and initialise the Alloy bootstrap first and extract all the cookies, then load Chrome bootstrap and insert the cookies but can only initialise CEF once per process so that becomes significantly more difficult
Still not sure what to use to detect "first run" of Chrome bootstrap (probably the existence of LocalPrefs.json and not Local State file at this stage), but I think following the steps outlined in that link might work for me. Will also need to consider what other files/folders should be cleaned up as part of the Alloy->Chrome bootstrap migration.
We don't plan to migrate cache directories automatically. CEF doesn't know what Profile-specific directory you were using previously, and not all files/directories are applicable between Chrome and Alloy bootstraps.
Activity
[-]v126.x seems to trash the cookies from prior versions[/-][+]v126.x unable to load cookies from prior version[/+]amaitland commentedon Jun 24, 2024
Thanks for the detailed testing 👍 It's important to remember that
CefSharpis just a wrapper around theChromium Embedded Framework(CEF).Try switching back to the
Alloy bootstrapto see if that makes a difference. Refer to #4835 (comment)Ultimately this will need to be raised at https://github.com/chromiumembedded/cef/issues
EamonHetherton commentedon Jun 24, 2024
Thanks for the prompt reply,
settings.ChromeRuntime = false;does appear to fix the issue with cookies still being loadable after the update. I'll try to dig deeper into the root cause.EugeneSunrise commentedon Jun 24, 2024
I had a similar problem, the point is that when we use chrome bootstrap(ChromeRuntume = true, since 125 ver.) cookies are encrypted with a key that is stored in the Local State file, but if we use alloy bootstrap cookies are encrypted with a key from LocalPrefs.json
amaitland commentedon Jun 24, 2024
Please raise an issue on the https://github.com/chromiumembedded/cef/issues (post a link back here for reference).
We'll need to see if
CEFcan handle this case gracefully.[-]v126.x unable to load cookies from prior version[/-][+]v126.x (Chrome bootstrap) unable to load cookies from prior version (Alloy bootstrap)[/+]EamonHetherton commentedon Jun 24, 2024
chromiumembedded/cef#3721
EamonHetherton commentedon Jun 24, 2024
I thought about trying to auto detect the first run with the Chrome bootstrap and initialise the Alloy bootstrap first and extract all the cookies, then load Chrome bootstrap and insert the cookies but can only initialise CEF once per process so that becomes significantly more difficult
EamonHetherton commentedon Jun 25, 2024
some success: chromiumembedded/cef#3721 (comment)
Still not sure what to use to detect "first run" of Chrome bootstrap (probably the existence of
LocalPrefs.jsonand notLocal Statefile at this stage), but I think following the steps outlined in that link might work for me. Will also need to consider what other files/folders should be cleaned up as part of the Alloy->Chrome bootstrap migration.Any thoughts on what else may need migrating?
EamonHetherton commentedon Jun 25, 2024
Work in progress migration, works for me YMMV :)
amaitland commentedon Oct 26, 2024
chromiumembedded/cef#3721 (comment)
As
CEFisn't going to support automatic migration, it'll be up to users to manually migrate if required.