Headless Chrome: How to restore and recover Cookies correctly between instances using DevTools Prot?

5,421 views
Skip to first unread message

nick...@gmail.com

unread,
Jul 3, 2017, 9:26:07 PM7/3/17
to headless-dev
Greetings,

We're working on a project that requires to automatically login to a Google Account and few other services.

However, as you may know, Headless Chrome does not remember cookies from previous instances, so we have to re-login to that account every time when we started a new Chrome instance.

It's very slow. So to speed it up (or by pass it), we were planing to save the all cookies from the previous Chrome instance to a file, and load that file for later instances.

But, that seems really hard to do because Network.setCookie require a url parameter, which didn't provided by Network.getAllCookies.

We can of course forge a url by using domain and path info of a cookie, but some times that won't work, as for example domain supports wildcard format, while the url don't. If we do that, our system will be buggy.

We also tries to read the Set-Cookie headers from HTTP responds provided by Network.responseReceived, but it not seems available there.

So, how to do it correctly? (Or is that possible to do it anyway?)

Thank you.

Jan Potoms

unread,
Jul 4, 2017, 3:22:42 AM7/4/17
to headless-dev, nick...@gmail.com

nick...@gmail.com

unread,
Jul 4, 2017, 3:35:44 AM7/4/17
to headless-dev, nick...@gmail.com
Well, that's disappointing. :(

Eric Seckler

unread,
Jul 4, 2017, 4:00:19 AM7/4/17
to nick...@gmail.com, headless-dev
There's also a bug about saving/restoring browser sessions (which include cookies).

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/2cff3d14-4301-4222-acb3-f0470ad2daf2%40chromium.org.
Message has been deleted

nick...@gmail.com

unread,
Jul 4, 2017, 5:19:38 AM7/4/17
to headless-dev, nick...@gmail.com
@Eric Seckler

I thought not loading Cookie was by design. So it's a bug? I really hope it can be fixed if it is.

Sorry by grammar suck

Eric Seckler

unread,
Jul 4, 2017, 5:20:03 AM7/4/17
to nick...@gmail.com, headless-dev
Both of these bugs are things we intend to fix in the future. However, I don't think anyone is currently working on them.

On Tue, Jul 4, 2017 at 10:16 AM <nick...@gmail.com> wrote:
@Eric Seckler

Oh I thought not loading Cookie was by design. So it's a bug? I really hope it been fixed if it is.


--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.

nick...@gmail.com

unread,
Jul 4, 2017, 6:43:35 AM7/4/17
to headless-dev, nick...@gmail.com
Well, that's sad.

I stared all issues, and hoping they can be fixed soon.

Thank you!

mba...@audioeye.com

unread,
May 18, 2018, 11:35:56 AM5/18/18
to headless-dev, nick...@gmail.com
Any updates yet?
Thanks,
- MB

Aymen BENNAFAA

unread,
Dec 7, 2022, 8:34:13 AM12/7/22
to headless-dev, mba...@audioeye.com, nick...@gmail.com
Just checking if the issue is fixed or it will be ?

Jerry Lee Daniel

unread,
Nov 19, 2023, 11:09:41 AM11/19/23
to headless-dev, Aymen BENNAFAA, mba...@audioeye.com, nick...@gmail.com
Loans, Project and Digital Investment financing available up to $500m.
Have a Business Plan, Fundable Project and Redeemable Collateral.

Whatsapp: +44 7405 896213
Reply all
Reply to author
Forward
0 new messages