diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-05-15 17:58:01 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-05-15 17:58:01 +0900 |
| commit | 6976ffed9e96ccc70f161aa5a38abddaf9d9befe (patch) | |
| tree | 00bedcfb75353caacbe97687804f5da5b529b3ea | |
| parent | 3443349fc3ea9b99a796bf4f2835950f75de729a (diff) | |
Adjust chromium cookie time
| -rw-r--r-- | src/Sqlite3CookieParserImpl.cc | 9 | ||||
| -rw-r--r-- | test/chromium_cookies.sqlite | bin | 3072 -> 3072 bytes |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/Sqlite3CookieParserImpl.cc b/src/Sqlite3CookieParserImpl.cc index 5d1ce849..751ead1c 100644 --- a/src/Sqlite3CookieParserImpl.cc +++ b/src/Sqlite3CookieParserImpl.cc @@ -59,8 +59,13 @@ Sqlite3ChromiumCookieParser::~Sqlite3ChromiumCookieParser() {} const char* Sqlite3ChromiumCookieParser::getQuery() const { - return "SELECT host_key, path, secure, expires_utc, name, value, " - "last_access_utc" + // chrome's time is microsecond resolution, and its epoc is Jan 1 + // 00:00:00 +0000 1601, so we have to convert it to second from UNIX + // epoc. 11644473600 is the second between chrome's epoc and UNIX + // epoc. e.g., date +%s -d 'Jan 1 00:00:00 +0000 1601' + return "SELECT host_key, path, secure, expires_utc / 1000000 - 11644473600 " + "as expires_utc, name, value, " + "last_access_utc / 1000000 - 11644473600 as last_access_utc" " FROM cookies"; } diff --git a/test/chromium_cookies.sqlite b/test/chromium_cookies.sqlite Binary files differindex c3e98fc8..e653715b 100644 --- a/test/chromium_cookies.sqlite +++ b/test/chromium_cookies.sqlite |
