Skip to content

Multiple cookies with the same name are not returned by "(await cookies()).getAll()" #95265

Description

@Lebuin

Link to the code that reproduces this issue

https://github.com/Lebuin/repro-nextjs-duplicate-cookies

To Reproduce

  1. Start the application in development mode
  2. In a terminal, run curl -H "Cookie: sessionid=a; sessionid=b" http://localhost:3000

Current vs. Expected behavior

According to the docs:

Getting all cookies

You can use the (await cookies()).getAll() method to get all cookies with a matching name. If name is unspecified, it returns all the available cookies.

In my reproduction, I'm passing 2 cookies with the same name "sessionid". I expect getAll() to return an array containing both values. Instead, it only returns the last encountered value.

  • Expected: {"Cookie header":"sessionid=a; sessionid=b","All cookies":["sessionid=a", "sessionid=b"],"Matching cookies":["sessionid=a", "sessionid=b"]}
  • Actual: {"Cookie header":"sessionid=a; sessionid=b","All cookies":["sessionid=b"],"Matching cookies":["sessionid=b"]}

The fact that the method getAll(name) exists at all, makes me think that my expectations do match to way the cookie store was designed.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026
  Available memory (MB): 15887
  Available CPU cores: 8
Binaries:
  Node: 24.14.1
  npm: 11.11.0
  Yarn: N/A
  pnpm: 10.14.0
Relevant Packages:
  next: 16.3.0-canary.70 // Latest available version is detected (16.3.0-canary.70).
  eslint-config-next: N/A
  react: 19.2.7
  react-dom: 19.2.7
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

Cookies

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

next dev (local), next start (local)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CookiesRelated to the async cookies() function.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions