Skip to content

Server-routes do not set cookies on netlify #15361

@kai-oswald

Description

@kai-oswald

Environment

Only occurs when deployed on netlify or running the project with netlify dev. Running locally with npm run dev is fine and cookies are set correctly.

Reproduction

https://github.com/kai-oswald/netlify-cookies

https://kaleidoscopic-dolphin-52510b.netlify.app/

Describe the bug

When deployed to netlify, the server api routes of a nuxt 3 project won’t set cookies.
I have checked the response headers and there is no ‘Set-Cookie’ header present on the response.

I have contacted netlify about this. This was their response:

This is a problem with Nuxt’s netlify adapter. As soon as I changed this to netlify-edge, it works. Please report this issue to Nuxt. Try here: https://fanciful-bienenstitch-665b81.netlify.app/api/cookie, repo here: https://github.com/Hrishikesh-K/nuxt-test

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions