Skip to content

Add RFC 6265 cookie jar for HTTP session carry#299

Merged
JE-Chen merged 1 commit into
devfrom
feat/cookie-jar-batch
Jun 21, 2026
Merged

Add RFC 6265 cookie jar for HTTP session carry#299
JE-Chen merged 1 commit into
devfrom
feat/cookie-jar-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 21, 2026

Copy link
Copy Markdown
Member

What

http_request is stateless — no session cookies persisted across calls, so a login-then-call REST flow couldn't carry a session headlessly.

  • CookieJar.update(set_cookie) — applies one or many Set-Cookie headers (removes a cookie on empty value / Max-Age<=0).
  • cookie_header() — builds the Cookie request header.
  • set, to_dict/from_dict, save/load (JSON persistence).
  • parse_set_cookie(header){name, value, attributes}.

Domain/path matching is simplified — a session-carry jar, not a full RFC 6265 policy engine.

Layers

  • Headless core: utils/cookie_jar/ (pure stdlib json, zero PySide6).
  • Facade: CookieJar, parse_set_cookie + __all__.
  • Executor: AC_cookie_header, AC_parse_set_cookie.
  • MCP: ac_cookie_header, ac_parse_set_cookie (read-only).
  • Script Builder: both under Data.
  • Tests: test/unit_test/headless/test_cookie_jar_batch.py (9 tests).
  • Docs: v91_features_doc.rst (EN + Zh) + toctrees + 3 README What's-new sections.

Verification

  • pytest test/unit_test/headless/test_cookie_jar_batch.py → 9 passed.
  • ruff check je_auto_control/ clean; pylint 10.00/10; bandit clean; radon CC clean.
  • Package stays Qt-free.

http_request is stateless — no session cookies persisted across calls, so
a login-then-call REST flow could not carry a session headlessly. Add a
CookieJar that parses Set-Cookie headers, builds the Cookie request
header, and saves/loads as JSON (cookies cleared on Max-Age<=0 or empty
value), plus parse_set_cookie. Wired through facade, executor
(AC_cookie_header / AC_parse_set_cookie), MCP, and the Script Builder with
a headless test batch and EN/Zh docs.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 45 complexity · 0 duplication

Metric Results
Complexity 45
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit beca532 into dev Jun 21, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/cookie-jar-batch branch June 21, 2026 19:03
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant