Blazor "session" storage #19715
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
Is your feature request related to a problem? Please describe.
Ability to save simple values (e.g.
string
,int
) that are available between route changes and page refreshes and understand how to implement itIs there a convention that is detailed somewhere?
Describe the solution you'd like
I've read the popular issues here on this topic and haven't been able to find a solution. Things are alluded to but no path finds an actual solution.
There are recommendations for:
localStorage
orsessionStorage
but no locatable, built-in way to implement them via ASP.NET Core/BlazorConnectionContext.Items
, which I couldn't get to work due to DI errorsHttpContext
session to_Host.cshtml.cs
, which is a limited workaroundClaimsPrincipal
, which requires adding Authentication.One of these will be fine if it solves it, but I can't tell if they are overkill. Ideally, there would be a package that gives access to the browser's
sessionStorage
(the one I'm likely to use), is used like a dictionary, and implements Data Protection.The text was updated successfully, but these errors were encountered: