mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #5853] fix: auto-store Set-Cookie headers and fix cookie retrieval #5380
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5380
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5853
Author: @FerreiraAdrien
Created: 2/9/2026
Status: 🔄 Open
Base:
main← Head:fix/auto-set-cookies-from-response-headers📝 Commits (3)
c3b42cffix: auto-store Set-Cookie headers and fix cookie retrieval0c7a0b8fix: correct cookie domain matching and Set-Cookie header parsing1177ae8fix: correct cookie domain matching and Set-Cookie header parsing📊 Changes
3 files changed (+91 additions, -13 deletions)
View changed files
📝
packages/hoppscotch-common/src/platform/std/kernel-interceptors/agent/index.ts(+4 -0)📝
packages/hoppscotch-common/src/platform/std/kernel-interceptors/native/index.ts(+38 -2)📝
packages/hoppscotch-common/src/services/cookie-jar.service.ts(+49 -11)📄 Description
Closes #3532
When an API response includes Set-Cookie headers, Hoppscotch does not automatically store those cookies in the cookie jar or send them with subsequent requests. Users have to manually add cookies for each domain, which breaks common authentication flows relying on httpOnly cookies.
What's changed
[x] Added applySetCookieHeaders method to CookieJarService that parses raw Set-Cookie header strings and upserts them into the cookie jar (merging by cookie name per domain)
[x] Hooked into the Agent interceptor response flow to automatically capture Set-Cookie headers and persist them via the new method
[x] Hooked into the Native interceptor response flow with the same auto-capture logic, handling both the structured response.cookies array and the raw header fallback
[x] Fixed getCookiesForURL to return stored Cookie objects directly instead of re-parsing cookieString.value, and fixed the expiry comparison to handle ISO string dates
Notes to reviewers
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.