views:

1310

answers:

5
+1  Q: 

Cookies in Firefox

Where does Firefox store cookies and in what format are they stored

A: 

The directory depends on your OS, but they appear to be stored in a SQLite database.

Thomas Owens
+4  A: 
VonC
Tools > Options > Privacy > Show Cookies works just as well without the plugin, IMO.
amdfan
In Windows XP, Joe's answer of C:\Documents and Settings\\Application Data\Mozilla\Firefox\Profiles\cookies.sqllite is correct, not what you currently have.
Thomas Owens
VonC
Ok: to all, I convert this answer in a community-wiki one. Edit away ;)
VonC
A: 

On XP, in the Application Data\Mozilla folder in C:\documents and settings.

For example, on my machine this is:

C:\Documents and Settings\\Application Data\Mozilla\Firefox\Profiles\\cookies.sqllite

Winston Smith
A: 

It's stored in PathFromCSIDL(CSIDL_APPDATA) + "Mozilla\Firefox\Profiles\" + [[profiledirectory]] + "\" + "cookies.sqlite" . There's also a cookies.txt file, but if will probably be empty. PathFromCSIDL can be implemented relatively easily via the windows API.

If your goal is to access cookies programmatically, you'll probably want to do this rather than hard-coding paths. Note that [[profiledirectory]] varies and there may be more than one profile and thus more than one directory, each profile/directory having its own cookies.

Brian
+1  A: 

Note that in Firefox 3.5, cookies.sqlite is locked exclusively by Firefox, so you have to make a copy of it before reading.

Also, cookies.sqlite may not be flushed to disk until Firefox exits, so you can't assume that the file on disk contains the cookies you need if Firefox is still running.

Dan Mitchell