Chrome headless (persistent) doesn't save/load cookies on windows
On Windows, headless chrome can't read cookies from a userdatadir. It is specific to cookies, localStorage works. The Default\Cookies file exists, and is a valid SQLite table, but it has no rows. Launching with headful, I can see the cookie in the SQLite file, but launching headless chrome afterwards clears the file again, and doesn't read the cookie.
Possibly related to, Puppeteer/Puppeteer#4111, but where that was flaky, this is consistently broken.
#680
Confirmed, my problem is the same. Take hours to figure this because it works fine on my Ubuntu machine.
i though i was going crazy, i am on win10 same problem headless true cookies don't get restored with it false it works fine, is there a workaround?
We need a solution for this issue please
Hello guys. Still face it on Version 86.0.4240.75 (Official Build) (64-bit) for Windows 10.
Confirmed, my problem is the same. Take hours to figure this because it works fine on my Ubuntu machine.
@meotimdihia maybe you just got lucky on Ubuntu with an older version of Chromium installed? I cannot get cookies from my —user-data-dir on either Windows or Ubuntu to work when in headless mode.
Same issue on headless Ubuntu Bionic, but with Webkit. The browser context has no cookie, won't set them after receiving a Set-Cookie header response, and I can't set them manually neither.
I'm also experiencing this and it's a bit frustrating :D
On Linux/MacOS, I do see that it stores session storage is created with headless mode. However on Windows 10, there's like 1 file in the 'user-dir' folder I specify.
Not sure if anyone has a workaround, if I find one I'll try to post it here.
Seeing the same issue but on MacOS. Most cookies persisted except for one. Everything runs fine with headless: false.
Same on MacOS
Why was this issue closed?
We are prioritizing the bugs based on the upvotes, recency and our ability to act. It looks like this issue only has a handful of upvotes, has not been touched recently and/or we lack sufficient feedback to act on it. We are closing issues like this one to keep our bug database maintainable. Please feel free to open a new issue and link this one to it if you think this is a mistake.
I'm also facing same issue on mac (local) and ubuntu (CI)
Still having the same issue on Mac with Chrome Version 98.0.4758.80 (Official Build) (x86_64)
Still experiencing this issue, Chrome 100.0.4896.127 on Windows 10. Is there ever going to be a fix for this?
Cookies are missing when running playwright with headless mode enabled. Happened at Chrome 103.0.5060.114 on macOS Big Sur Version 11.6 with M1 Chip.
I confirm this very problem on Mac. I run with --user-data-dir and when I run in --headless mode, the cookies saved from previous runs are not loaded. When I disable --headless, the cookies load normally.
Google Chrome 106.0.5249.103
The only way is to save cookies into a file manually after every page load, and then load that file manually on next init.
Any solutions to this? Still having the same problem, set-cookies header is missing on the response.
Here, cookies do not load if the browser is in --headless mode.
Same here, cookies do not load if browser is in --headless mode. We need a solution for this.