-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Question: How to use sessions correctly in Blazor? #12432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for contacting us, @SeppPenner . |
No, we don't have specific guidance. The |
I already experienced that 😄 |
This isn't directly related to your, @SeppPenner, question here, but I just wanted to note that we just published Steve's state persistence doc at https://docs.microsoft.com/aspnet/core/blazor/state-management?view=aspnetcore-3.0 today. It won't help you with session, but it does clarify the current guidance on state persistence. If engineering rolls out new state persistence scenarios, we/they will cover the new bits in that topic going forward. |
Related: #5330 |
https://docs.microsoft.com/aspnet/core/blazor/state-management?view=aspnetcore-3.0 is definitely the way to go for Blazor. As @anurse mentions there's no guarantee that the HttpContext.Session is available in SignalR (and hence neither in Blazor). |
Question
How can I use sessions in Blazor correctly? The answers I found:
cloudcrate/BlazorStorage
from https://github.com/cloudcrate/BlazorStorage (@SteveSandersonMS did this on the NDC 2018, check https://www.youtube.com/watch?v=JU-6pAxqAa4&feature=youtu.be&t=2875). However, I don't want to do this on the client side...HttpContext.Session
fromMicrosoft.AspNetCore.Http
as described here https://docs.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-3.0. There, I fell over App session and app state update to 3.1 AspNetCore.Docs#13328, where it's requested toupdate app session and app state to 3.0
.My question now: What's the way to go with Blazor?
The text was updated successfully, but these errors were encountered: