Add RFC 6265 cookie jar for HTTP session carry#299
Merged
Conversation
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.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 45 |
| Duplication | 0 |
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
http_requestis 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 manySet-Cookieheaders (removes a cookie on empty value /Max-Age<=0).cookie_header()— builds theCookierequest 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
utils/cookie_jar/(pure stdlibjson, zero PySide6).CookieJar,parse_set_cookie+__all__.AC_cookie_header,AC_parse_set_cookie.ac_cookie_header,ac_parse_set_cookie(read-only).test/unit_test/headless/test_cookie_jar_batch.py(9 tests).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.