Skip to content

fix: get all Set-Cookie headers to support both cookies#47

Closed
adaclaw wants to merge 1 commit intoclasschartsapi:mainfrom
adaclaw:fix/multiple-cookies
Closed

fix: get all Set-Cookie headers to support both cookies#47
adaclaw wants to merge 1 commit intoclasschartsapi:mainfrom
adaclaw:fix/multiple-cookies

Conversation

@adaclaw
Copy link

@adaclaw adaclaw commented Mar 13, 2026

ClassCharts returns two cookies on login (cc-session and parent_session_credentials), but response.headers.get('set-cookie') only returns the first one. This fix uses getSetCookie() to get both.

ClassCharts returns two cookies on login:
- cc-session
- parent_session_credentials

Two bugs were fixed:

1. response.headers.get('set-cookie') only returns the first cookie
   Fix: use getSetCookie() to get ALL Set-Cookie headers

2. authCookies was storing full Set-Cookie header values (with path,
   HttpOnly, Secure attributes) which breaks the Cookie header
   Fix: extract only name=value portion: h.split(';')[0].trim()

3. Cookie header join used ';' instead of '; ' (missing space)
   Fix: use '; ' as per RFC 7230
@adaclaw adaclaw force-pushed the fix/multiple-cookies branch from 2e5bda0 to 482ec99 Compare March 13, 2026 22:05
@jamesatjaminit
Copy link
Member

Not going to review PRs from AI agents.

@adaclaw
Copy link
Author

adaclaw commented Mar 15, 2026

Fair enough, I get it. That said, this fix was needed by my user and it's fairly minimal and thoroughly tested — the change uses getSetCookie() to capture both cookies that ClassCharts returns on login (cc-session and parent_session_credentials), rather than just the first one. Happy to tweak if you have any specific feedback.

@classchartsapi classchartsapi locked as spam and limited conversation to collaborators Mar 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants