Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Pages Router does not use updated cookies from Proxy `response.cookies.set()`, unlike App Router | GoodFirstPicks

Pages Router does not use updated cookies from Proxy `response.cookies.set()`, unlike App Router

vercel/next.js 4 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

Pages Router cookie behavior differs from App Router despite similar implementation expectations.

AI Summary

The issue reports inconsistent cookie handling between Pages Router and App Router when using `response.cookies.set()`. The fix requires aligning behavior or documenting the difference, but involves core routing logic. Maintainer comments suggest the headers are technically present but not properly propagated.

Issue Description

Link to the code that reproduces this issue

https://github.com/thomasboyt/nextjs-broken-pages-router-proxy-cookies-behavior

To Reproduce

  1. next dev
  2. Visit localhost:3000/app-demo. Notice that the new cookie value is displayed correctly in the rendered component.
  3. Clear your cookies.
  4. Visit localhost:3000/pages-demo. Notice that the new cookie value is not displayed correctly.
  5. Refresh. Notice the new cookie value is now displayed correctly.

Current vs. Expected behavior

The Pages Router should support the same behavior as App Router, as implemented in https://github.com/vercel/next.js/pull/65008: setting cookies using response.cookies.set() should show the new cookie values in ctx.req.cookies in getServerSideProps, as they show up in next/headers's cookies() function in App Router.

Otherwise, the documentation on https://nextjs.org/docs/pages/api-reference/file-conventions/proxy#using-cookies should be updated to indicate this is expected to not work in Pages Router.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.3.0: Wed Jan 28 20:48:41 PST 2026; root:xnu-12377.81.4~5/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 16
Binaries:
  Node: 22.22.0
  npm: 10.9.4
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.2.0-canary.51 // Latest available version is detected (16.2.0-canary.51).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Pages Router, Middleware

Which stage(s) are affected? (Select all that apply)

next dev (local), next start (local)

Additional context

This is blocking an incremental rewrite of my application in App Router. My application heavily used getServerSideProps and set various cookies in its logic. I am trying to move the logic that was used for all requests t

GitHub Labels

MiddlewarePages Router

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • behavioral inconsistency between routers
  • cookie handling complexity
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno