solid-primitives
solid-primitives copied to clipboard
[storage] make it clear that a cookie cannot be set server-side or fix that it cannot be set server-side
Describe the bug
When creating a cookie using makePersistent, you cannot set the cookie server-side in any way. There is no way to cause the code to set the cookie to be invoked in any way. This is not documented. So cookies must be set client, and can be read server, but not set on the server.
Maybe is due to signals not firing during SSR or fetch events, therefore nothing hears the change in the signal to write the header? And there is no work around to use the same storage to manually write the cookie on the server, you would have to implement it completely independently of the code.
no reproducible case as this can't be shown via stackblitz, no?
Minimal Reproduction Link
https://stackblitz.com/github/solidjs/templates/tree/master/ts?file=src%2Findex.tsx