Skip to content

Cookies still in a browser's WAL are invisible to every sqlite-backed store #117

Description

@fmguerreiro

browserutils/sqlite3 never opens the -wal file, so every store kooky reads through it returns data as of that store's last checkpoint. Chrome, Firefox and Epiphany all call sqlite3.OpenFrom in their cookiestore.go, so a cookie a running browser wrote minutes ago can just be missing.

It showed up for me as a missing github.com user_session: the cookie was in a 754KB cookies.sqlite-wal while the main file still had logged_in and dotcom_user. The consuming tool reported no session for a browser that was signed in, and nothing tells that apart from actually being logged out.

Fix is a level down, in browserutils/sqlite3#1, which indexes the log and reads those pages from it. If that lands, kooky picks it up on a dependency bump with no code change here. I built kooky against it and the cookie shows up.

One thing to watch on kooky's side: sqlite3.OpenFrom finds the log by checking the reader for Name() string, which works because utils.OpenFile returns an *os.File. If that ever becomes a copy or a wrapper without Name(), the log is silently skipped and you're back to checkpoint-only reads.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions