Adjust chromium cookie time

This commit is contained in:
Tatsuhiro Tsujikawa 2016-05-15 17:58:01 +09:00
parent 3443349fc3
commit 6976ffed9e
2 changed files with 7 additions and 2 deletions

View File

@ -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";
}

Binary file not shown.