0

In Firefox, I can download cookies from all domains using Ganbo.

# Cookies for this tab
# Click here to download them
# Click here to download cookies for all domains

However, I could not find a single extension in chrome that download cookies from all domains in a single file. With Chrome I can only download cookies for a single domain by using Get cookies.txt or extensions like that.

I checked How do I copy cookies from Chrome?. But the solutions there does not solve my particular problem.

How can I download cookies from multiple domains in a single file in chrome?

Ahmad Ismail
  • 11,636
  • 6
  • 52
  • 87
  • 1
    Why do you want to do this? (This smells like an X/Y Problem) – Dai Feb 08 '21 at 03:45
  • "How can I download cookies for all domains in Chrome?" - as far as I know **you can't** - at least, not without dumping your local Chrome profile database. – Dai Feb 08 '21 at 03:46
  • You aren't "downloading" cookies, btw – Dai Feb 08 '21 at 03:47

1 Answers1

0
  1. Locate your Cookies file in your Chrome profile directory:
    • On Windows, this is typically C:\Users\<your_username>\AppData\Local\Google\Chrome\User Data\Default\Cookies
    • There is no file extension.
  2. Use a SQLite database file editor to open the Cookies file.
    • You may need to copy the Cookies file elsewhere first if Chrome has a lock on the file (Windows File Explorer can safely copy locked-files as it uses the Shadow Copy API for locked files).
  3. Dump the cookies table.

With screenshots:

Step 1: Locate the Cookies file:

enter image description here

Step 2: Open the Cookies file in a SQLite editor:

enter image description here

Step 3: Access the cookies table:

Cookie values are not stored in the value column - they're actually stored in the encrypted_value and encrypted with DPAPI (on Windows). I don't know how they're encrypted or stored on macOS, Linux, Android, or any other OS (as DPAPI is specific to Windows).

This QA has an example of how to decrypt the cookie values on Windows using C#: Encrypted cookies in Chrome

enter image description here

Dai
  • 141,631
  • 28
  • 261
  • 374
  • It is my fault that I did not give some details earlier. I am using Linux Mint (Ubuntu). I actually want to use the cookie file with `youtube-dl`. It needs to be in Firefox format. `Get cookies.txt` give it in firefox format but not for all domains. Do you have any idea how to get cookies for all domains in firefox format, in Linux Mint (Ubuntu). It will be great if you could extend the answer for the given details. – Ahmad Ismail Feb 08 '21 at 06:58