Skip to content

fix: re-apply Cloudflare Pages Function proxy for iOS/Android cookie support#28

Merged
pkmaster21 merged 5 commits intomainfrom
fix/re-apply-proxy
Apr 16, 2026
Merged

fix: re-apply Cloudflare Pages Function proxy for iOS/Android cookie support#28
pkmaster21 merged 5 commits intomainfrom
fix/re-apply-proxy

Conversation

@pkmaster21
Copy link
Copy Markdown
Owner

Re-applies the proxy approach that was reverted in PR #26. The Cloudflare API token was the blocker — it has now been rolled and the GitHub secret updated.

This fixes guest session cookies on iOS (WebKit ITP) and Android Chrome incognito by routing all /api/* requests through a same-origin Cloudflare Pages Function instead of directly to the API Gateway cross-origin.

Re-applies: c3ae915, 27e87b8, 644c697, c166847, 3a2f26b

…est sessions

iOS Safari's ITP blocks Set-Cookie headers from cross-origin fetch() requests,
even with SameSite=None; Secure, causing guest session tokens to never be stored.
Adds a catch-all Pages Function that proxies /api/* to the backend API_URL so all
requests are same-origin and cookies are treated as first-party.
…sions

SameSite=None was causing iOS WebKit (used by all browsers on iPhone,
including Chrome) to drop session cookies due to ITP restrictions, even
for first-party cookies set via fetch() responses. Since all API calls
now go through the same-origin Cloudflare Pages Function proxy, there
is no need for SameSite=None — SameSite=Lax works correctly for
same-site requests and is fully trusted by iOS WebKit.

Also fixes the Pages Function proxy to use getAll('set-cookie') instead
of forEach() when forwarding Set-Cookie headers, preventing the
Cloudflare Workers runtime from collapsing multiple cookies into a
single comma-joined string.
The env: key in the wrangler-action step only sets shell environment
variables for the wrangler process — it does not configure Cloudflare
Pages Function runtime environment variables. Added an explicit PATCH
call to the Cloudflare Pages API to set API_URL before deploying, so
the proxy function correctly resolves the upstream API Gateway URL.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying tabby with  Cloudflare Pages  Cloudflare Pages

Latest commit: d9068a3
Status: ✅  Deploy successful!
Preview URL: https://91ce4228.tabby.pages.dev
Branch Preview URL: https://fix-re-apply-proxy.tabby.pages.dev

View logs

@pkmaster21 pkmaster21 merged commit 0481fb7 into main Apr 16, 2026
7 checks passed
@pkmaster21 pkmaster21 deleted the fix/re-apply-proxy branch April 16, 2026 18:09
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