3

I would like to get access to the Chromium cookies on the command line -- externally to chrome and without the use of any extensions. Where does Chromium store the cookies on disk? Is this possible and how would I go about doing it?

I have an external utility that wants to authenticate with a cookie of a session that has already passed authentication. I do not want to have to keep opening up the Chromium Dev tools and finding it to copy-and-paste.

1 Answer 1

2

The cookie database is stored in,

~/.config/chromium/Default/Cookies

Where "Default" will change if you actually create profiles in Chromium. You will want name and encrypted_value from the cookies table.

SELECT name,encrypted_value
FROM cookies
WHERE host_key = "mysite.com";

From the command line that looks like this

cat <<EOT | sqlite3 "$HOME/.config/chromium/Default/Cookies" -json
    SELECT name,encrypted_value
    FROM cookies
    WHERE host_key = "foobar.com";
EOT

Decrypting the encrypted_value is a bit complex. I'll answer how to do that this week.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .