Howto read/export firefox cookies in linux

Firefox cookies are stored in sqlite database.
in ubuntu the cookies are locate in /home/username/.mozilla/firefox/random.default/cookies.sqlite

to locate the cookies.sqlite just type

locate cookies.sqlite

To read the cookies we need to install sqlite3.

To install it in ubuntu/debian

sudo apt-get install sqlite3

open the cookies with sqlite3

sqlite3 /home/username/.mozilla/firefox/random.default/cookies.sqlite

after you have opened the db type

select * from moz_cookies;

to show mozilla firefox cookies.

if you want to export them type

.output mozilla_cookies.txt
select * from moz_cookies;

Comments

Thanks

I can't get it to work yet but thanks for sharing.

Did u replace?

@anonymous

You have to replace "username" and "random".

Thanks rex for sharing!

HELP

so when i use the command select * from moz_cookies; i just get returned to the sqlite3 prompt with no output like its empty or something, but there are clearly cookies when i view them in firefox preferences. am i missing something? it shows the table when i do .tables

sqlite commands

Hi

tried that not working here either i have the correct path/to/file/cookies.sqlite

but just get ...> returned to me ?

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Use <pre> all your html php come here </pre> for your code
  • Allowed HTML tags: <a> <b> <pre> <h1> <h2> <h3> <h4> <h5> <h6> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <div> <style><img> <br> <blockquote>
  • Lines and paragraphs break automatically.
  • You may insert videos with [video:URL]

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

CafeWebmaster.com(CW) is a free online community for webdevelopers and beginners. Anybody can share their code, articles, tips, tutorials, code-examples or other webdesign related material on the site. Newbies can submit their questions and reply to existing questions. CW does not guarantee or warrant reliability of code, data and information published on the site. Use the site on your own risk. The site takes no responsibility of direct or indirect loss or any kind of harm to its users. The site also doesn't take responsibility of infected files or source code with any kind of infection or viruses, worms, spywares, malwares, trojan horses. CW reserves the right to edit, move, or delete any of content for any reason.