moshest / next-client-cookies

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

HttpOnly cookies are exposed when cookies.getAll() is passed #9

Closed colinclerk closed 1 year ago

colinclerk commented 1 year ago

The technique used in the demo is dangerous, since HttpOnly cookies will be written to the document body: https://github.com/moshest/next-client-cookies/blob/main/demo/app/layout.tsx#L17

Instead, an explicit allowlist can be used to specify which cookie names get passed to the provider.

moshest commented 1 year ago

I guess we don't need to pass the cookies to the client. We just need a place to store then while rending on the server-side.

moshest commented 1 year ago

Fixed at v1.1.0-alpha.0