Skip to content

fix: apply redirect Set-Cookie headers during single flight mutations - #2243

Merged
birkskyum merged 4 commits into
solidjs:mainfrom
birkskyum:fix-issue-1962
Jul 27, 2026
Merged

fix: apply redirect Set-Cookie headers during single flight mutations#2243
birkskyum merged 4 commits into
solidjs:mainfrom
birkskyum:fix-issue-1962

Conversation

@birkskyum

Copy link
Copy Markdown
Member

When a server action returns or throws a response carrying cookies, for example redirect("/", { headers: { "Set-Cookie": ... } }), those cookies reached the browser but not the single flight re-render of the redirect target. Queries reading that cookie during the same flight still saw the old request cookies, so the result differed from a real browser round trip.

createSingleFlightHeaders now also merges the Set-Cookie values from the action result, applied after the ones already on the event response so they win on conflict. Only cookies are merged, not all response headers: copying Location, Content-Type and friends onto a synthetic request would be wrong, and cookies are what a round trip would actually have carried back.

Covered by unit tests in handler.spec.ts and an e2e repro at apps/tests/src/routes/single-flight-cookie.tsx.

@changeset-bot

changeset-bot Bot commented Jul 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7e0df3a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/start Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlify Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit 7e0df3a
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/6a667b23eedd0200083e1dc5
😎 Deploy Preview https://deploy-preview-2243--solid-start-landing-page.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Jul 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/start@2243

commit: 7e0df3a

@birkskyum
birkskyum requested a review from katywings July 26, 2026 13:56
@birkskyum birkskyum added the Start 2.x targeting SolidStart 2.x versions label Jul 26, 2026
@birkskyum
birkskyum requested a review from brenelz July 26, 2026 21:24
@birkskyum
birkskyum merged commit 5c8612f into solidjs:main Jul 27, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Start 2.x targeting SolidStart 2.x versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug?]: Set-Cookie header not applied to request during single-flight mutation (SFM)

2 participants