Skip to content

Cookies still in Firefox's WAL are invisible, so check-token reports no token when logged in #43

Description

@fmguerreiro

gh image check-token says "no session token found" for a Firefox that's logged in. The user_session cookie was in cookies.sqlite-wal, not cookies.sqlite, because Firefox hadn't checkpointed yet.

Not a gh-image bug. kooky reads through browserutils/sqlite3, which never opens the -wal file, so every Chromium and Firefox store reads as of its last checkpoint. On a browser that's been open a while, that can hide hours of writes.

Fix is upstream in browserutils/sqlite3#1. Once it lands, kooky needs a dependency bump and gh-image needs a kooky bump. I built gh-image against the patch and check-token returns Token is valid (source: browser cookies) with nothing else changed.

Easy to misfile as a browser-detection problem, since it looks the same. The tell: cookies.sqlite-wal is non-empty, and user_session is missing from the main file while the browser is clearly signed in. Copy the db without its -wal to check, since the sqlite3 CLI reads the log and will show you the cookie.

Workaround: copy cookies.sqlite and cookies.sqlite-wal together somewhere, read user_session from the copy, and pass it as GH_SESSION_TOKEN.

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstreamCaused by a limitation in an upstream dependency (kooky, sqlite3)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions