forked from ionic-team/capacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
chore: sync upstream PR #8249 - fix(ios): remove percent-encoding of cookie values in CapacitorCookies #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 237
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 125
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 5505
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 47
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 2809
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 5157
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 121
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 2910
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 5169
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 1430
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 47
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 106
🌐 Web query:
HTTPCookie.cookies(withResponseHeaderFields:for:) RFC 6265 special characters encoding iOS💡 Result:
Short answer
What this means for your iOS code
Practical recommendations
References
If you want, tell me the exact characters or an example cookie value you need to send and I’ll show the exact percent‑encoding or base64 approach and the decoding code on iOS.
Citations:
🌐 Web query:
Capacitor PR #8249 cookies percent encoding fix💡 Result:
I couldn’t find a GitHub pull request ionic-team#8249 for Capacitor. I searched the ionic-team/capacitor repo and related docs — there are recent cookie-related issues (e.g. “CapacitorCookies percent-encodes cookies on iOS (and not on Android)” as issue ionic-team#8248) and general cookie reports, but no PR numbered 8249. Sources:
If you want, I can:
References
🌐 Web query:
Capacitor issue #8248 percent-encode cookies iOS Android💡 Result:
There’s an open GitHub issue for this: "CapacitorCookies percent-encodes cookies on iOS (and not on Android)" (issue ionic-team#8251) — opened Nov 21, 2025 on the ionic-team/capacitor repo. Related cookie problems (third‑party/persistence) are also tracked in other Capacitor issues (e.g. ionic-team#6302). [1][2]
Sources:
🏁 Script executed:
Repository: Cap-go/capacitor-plus
Length of output: 47
HTTPCookie does not automatically encode/escape special characters—validation or encoding must be implemented before interpolating user input into the Set-Cookie header.
RFC 6265 forbids unencoded special characters (semicolons, equals signs, spaces, quotes, commas, backslashes, control characters) in cookie values. Per the iOS Foundation documentation,
HTTPCookie.cookies(withResponseHeaderFields:for:)follows RFC 6265 parsing and will either reject or mispars non-compliant headers—it does not perform encoding.The current code at line 60 of CapacitorCookieManager.swift directly interpolates the user-provided
valueinto the Set-Cookie header string without encoding or validation:Required actions:
;,=, spaces, quotes, etc.)🤖 Prompt for AI Agents