Replies: 1 comment
-
To add a little more context since we've been working on debugging this together: I'm pretty sure what's going on here is that the initial response is returning an HTML stream, and that the session is being checked during one of the later chunks. The later navigation is just calling accessing the session data in a more traditional request/response fetch, and works properly. I have run into similar issues with streaming responses and other crates (for example, an Axum auth crate) — accessing the session before sending the first chunk returns correctly, accessing the session during a later chunk does not. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a handler that is meant to check whether the user is signed in. I am also using leptos for ssr+hydration.
I noticed that for whatever reason,
session.get()
returns aNone
whenever I first load the page or refresh it. It doesn't happen when I navigate to the page with client side navigation.To debug this, I logged the
HttpRequest
for every call to this function. In every case where I expected a cookie, I found one in the request.For more context:
None
when it shouldn't.And finally, here are the
HttpRequests
that I logged:When refreshing/first load:
When navigating to the page:
The cookie is in both requests but
session.get::<String>("id")
still returnsNone
for the first one. Any help is appreciated, TIA.Beta Was this translation helpful? Give feedback.
All reactions