Skip to content

CDP-injected cookies lost on graceful exit #806

Description

@XDLCS

Steps to reproduce

  1. Start the automation server with a cookie file:
touch cookies.tsv   # empty file, TSV format
moli serve --port 9333 --cookie-file cookies.tsv
  1. Via CDP: navigate to any page, then Network.setCookie {name: "c1", value: "v1", url: "http://127.0.0.1/..."} — returns success: true, and the cookie is visible via document.cookie.
  2. Also set a cookie from JS: document.cookie = 'c2=v2; path=/' — visible in-session.
  3. SIGTERM the server (graceful exit) and inspect cookies.tsv.

Expected

Both cookies are persisted, as page-network-stack Set-Cookie cookies are.

Actual

cookies.tsv is empty after the graceful exit — CDP-injected and JS-set cookies are both lost. Network-stack Set-Cookie cookies from page loads persist correctly, so the persistence layer itself works.

Impact

Agent login flows that seed cookies via CDP lose state across restarts.

Suggestion

Route CDP-injected and document.cookie writes through the same persistence path as network-stack Set-Cookie.

Environment

  • moli 1.1.10 (9b2f86b), Linux, serve + CDP

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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