I can't initialize a session
In this code, I use
When I start the application for the first time, or when I manually remove the
I don't exactly understand why I get the error. In seems like calling
useSession to create a session and initialize it with "light" if it doesn't have a value:When I start the application for the first time, or when I manually remove the
theme cookie in the devtools and refresh the page, I get this error:I don't exactly understand why I get the error. In seems like calling
useSession immediately sends the response to the client, so session.update() fails because the response is already sent. That's not what expected to happen. Am I doing something wrong?