moshest / next-client-cookies

SSR and client support for cookies in Next.js 13 (app directory)
MIT License
144 stars 9 forks source link

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

Closed IonelLupu closed 1 year ago

IonelLupu commented 1 year ago

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?

moshest commented 1 year ago

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.