Skip to content

next/image ignores cookie from original request #82875

@ThomasAunvik

Description

@ThomasAunvik

Link to the code that reproduces this issue

https://github.com/ThomasAunvik/nextimage-cookies

To Reproduce

  1. Start the application
  2. See two missing images, click on "Get Cookie". You will get a session_token cookie.
  3. Reload the page
  4. See that the only loaded image is the unoptimized one.

Current vs. Expected behavior

Due to cookies not being present in the next/image optimization, it doesn't load the image.

I expect both images to load. I expect the cookie to be present in the optimized request aswell.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 ZEN SMP PREEMPT_DYNAMIC Fri, 15 Aug 2025 16:04:24 +0000
  Available memory (MB): 15774
  Available CPU cores: 8
Binaries:
  Node: 24.6.0
  npm: 11.5.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 15.5.1-canary.2 // Latest available version is detected (15.5.1-canary.2).
  eslint-config-next: N/A
  react: 19.1.1
  react-dom: 19.1.1
  typescript: 5.9.2
Next.js Config:
  output: N/A

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

Image (next/image)

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

next dev (local)

Additional context

Seems to be a regression from previous versions.

It appears it has worked in 15.3.2 but not at 15.4.6 either.

I will have to update at on which exact version it stopped working at.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Image (next/image)Related to Next.js Image Optimization.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions