moshest / next-client-cookies

SSR and client support for cookies in Next.js 13 (app directory)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cookies not available on SSR after setting them in a client component

IonelLupu opened this issue · comments

Check out the demo in this repo: https://github.com/IonelLupu/next-client-cookies

I have the main client component which sets a cookie. At the same time, I have some other component which needs that cookie value so it gets it from the cookie store.

The problem is that the component that reads the cookie is not receiving a value in the SSR step. What are the solutions here?

HI @IonelLupu, this problem already been fixed on v1.0.4.

The demo folder uses the older version, please upgrade and you will see it fixed.