Get cookies from incognito impossible

Hi there,

the new option to get Cookies from Chrome Dev Tools seems to fail if Chrome is started with „–incognito“.

Best
Mike

1 Like

Hi Mike,

while I don’t know for certain, I assume that this might be an intentional decision from the Chrome devs, to not give access to the cookie via API when running in “incognito” - this is just an assumption though.

Anyways, taking a step back: Is there a specific reason why you start Chrome with the incognito flag? Basically all new browser instances created by the Selenium nodes are a “blank paper” without any history, data, storage, cookie, etc. from previous sessions. Thus I’m wondering if you need the incognito mode at all?

Best,
Philipp

Hey Phillip,

Very valid point of yours. Though, I had thought the API kind of “has the high ground” over incognito mode.

I happen to notice that clearing cookies via a JavaSnippet Node and:

driver.manage().deleteAllCookies();

did only work for the site you currently navigated to but if you visited multiple domains, it does not apply for all. Navigating to chrome://settings/clearBrowserData and trying to delete the data that way doesn’t work as the clickable element can’t be found.

Therefore I attempted to fallback into incognito as when that webdriver gets terminated, so do it’s cookies. That, apparently, failed which is why I submitted this ticket.

Worth to note, I did some testing and, albeit being inconvenient, I re-initate the webdriver now. It adds a minuscule performance penalty but that’s the most straight way forward.

Cheers
Mike

Regarding clearing the cookies (you’ve been in touch about that via email) - this is something where a dedicated node would make sense. I’ve put it on the list for one of the next releases. I’ll keep you posted (also here in the thread)

Worth to note, I did some testing and, albeit being inconvenient, I re-initate the webdriver now. It adds a minuscule performance penalty but that’s the most straight way forward.

:+1: Indeed, that’s the best, recommended option for now (despite the performance overhead)

Have a good weekend,
Philipp

2 Likes

Update: Version 4.11.0 has an option to delete Cookies in the updated node:

Changelog:

2 Likes