Next.js Discord

Discord Forum

Cookies on server component disappears on RSC

Unanswered
MateoB posted this in #help-forum
Open in Discord
Hello guys, I need to know why my cookies disappear after the first render, on the rsc fetchs. I've a session cookie setted on a server action with httpOnly and Secure true, the content is an idToken from firebase.

The cookie is set but when I go to a Server component, ex the register page (yea it's a server comp) the cookie is shown the first time, and after two re-renders it's not anymore. I also put a console log on the middleware to catch it before and the cookie isn't there too, the first time yes but not when a rsc fetch is made.

2 Replies

please I need help I'm stuck with this a day ago
done. it was an issue with cloud run, it deletes all cookies that aren't __session, lol.