In a server-side Blazor app I'd like to store some state that is retained between page navigation. How can I do it?
Regular ASP.NET Core session state does not seem to be available as most likely the following note in Session and app sate in ASP.NET Core applies:
Session isn't supported in SignalR
apps because a SignalR Hub may
execute independent of an HTTP context. For example, this can occur
when a long polling request is held open by a hub beyond the lifetime
of the request's HTTP context.
The GitHub issue Add support to SignalR for Session mentions that you can use Context.Items. But I have no idea how to use it, i.e. I don't know hot to access the HubConnectionContext
instance.
What are my options for session state?
No comments:
Post a Comment