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
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
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 aNonewhenever 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
HttpRequestfor every call to this function. In every case where I expected a cookie, I found one in the request.For more context:
Nonewhen it shouldn't.And finally, here are the
HttpRequeststhat I logged:When refreshing/first load:
When navigating to the page:
The cookie is in both requests but
session.get::<String>("id")still returnsNonefor the first one. Any help is appreciated, TIA.Beta Was this translation helpful? Give feedback.
All reactions