Firefox cookie database
Dan Tobias (Talk | contribs) (→Links) |
(Expand with information on how datetime fields are formatted) |
||
Line 9: | Line 9: | ||
The structure is seen in this SQL command embedded in the file: | The structure is seen in this SQL command embedded in the file: | ||
− | <code>CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER, baseDomain TEXT, creationTime INTEGER)</code> | + | <code>CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT, expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER, baseDomain TEXT, creationTime INTEGER)</code> |
+ | |||
+ | |||
+ | == Datetime formats == | ||
+ | There are 3 dateime fields: '''expiry''', '''lastAccessed''', and '''creationTime'''. | ||
+ | |||
+ | <code>expiry</code> is stored in standard [[Unix time|Unix timestamp]] format. In SQLite, this can be converted to a human-readable format with <code>datetime("expiry", 'unixepoch')</code>. | ||
+ | |||
+ | However, <code>lastAccessed</code> and <code>creationTime</code> are in microseconds. To convert to a human-readable format in SQLite use <code>datetime(("creationTime"/1000000),'unixepoch')</code>. | ||
== Links == | == Links == |
Revision as of 04:59, 16 August 2022
Cookies in Firefox are stored in an SQLite format database found in the file cookies.sqlite in the currently-active user profile directory (exact path is system-dependent). Also, the write-ahead-logging and shared-memory files cookies.sqlite-wal and cookies.sqlite-shm are used, but the latter two are re-integrated into the main database file and deleted when you close the browser.
The structure is seen in this SQL command embedded in the file:
CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT, expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER, baseDomain TEXT, creationTime INTEGER)
Datetime formats
There are 3 dateime fields: expiry, lastAccessed, and creationTime.
expiry
is stored in standard Unix timestamp format. In SQLite, this can be converted to a human-readable format with datetime("expiry", 'unixepoch')
.
However, lastAccessed
and creationTime
are in microseconds. To convert to a human-readable format in SQLite use datetime(("creationTime"/1000000),'unixepoch')
.