-
-
Notifications
You must be signed in to change notification settings - Fork 96
Description
Hello, thanks for creating all these helpers! I've been wondering if I've been doing something horribly wrong, but the use_cookie
helper doesn't seem to actually be able to set cookies in server functions. Meanwhile, it is possible to set cookies in server functions using leptos_actix
. I gave the source code a cursory look, and that seems to be what it's doing, so I'm not sure what's going wrong.
I've created a minimal example demonstrating this: steadygaze/start-actix-use-cookie-repro@b45e30d
So, there is this note in the Leptos-Use site
This works equally well on the server or the client. On the server this function reads the cookie from the HTTP request header and writes it back into the HTTP response header according to options (if provided). The returned WriteSignal may not affect the cookie headers on the server! It will try and write the headers buy if this happens after the headers have already been streamed to the client then this will have no effect.
but I don't think streaming is coming into play if leptos_actix
is able to set the headers still.
Secondarily, cookies updated on the server won't update in SSR, but the docs already note this. Is there a way to say "ok, recheck the cookies now because I think they might've changed"? (For context, this is the general thing I'm trying to do: leptos-rs/leptos#3609.)