Skip to content

Setting cookies during SSR? #1499

Closed Answered by gbj
lephyrius asked this question in Q&A
Aug 4, 2023 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

If you providing an example of some code, people could try to help debug. Otherwise, we can only guess. My guess is that you should use create_blocking_resource for the resource where you're calling the server function that writes the cookie, because otherwise the headers of the HTTP response will already have been sent by the time that Suspense resolves and it will be too late.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@lephyrius
Comment options

@NicTanghe
Comment options

@benwis
Comment options

@benwis
Comment options

Answer selected by benwis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants