Next.js Discord

Discord Forum

Cookies with streaming

Unanswered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
Hello, my app works like this: nextjs serverside performs graphql queries to external backend (which sometimes returns set-cookie headers, like session cookies). When the backend returns cookies, I set them with (await cookies()).set(...).

However, I ran into an issue when streaming (for example get products from backend, with that response I get new session cookie). I can't set the cookie (because only Server Action or Route Handler can set cookies). Are there any solutions to this?

0 Replies