Skip to content
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

Blazor "session" storage #19715

Closed
mrlife opened this issue Mar 9, 2020 · 2 comments
Closed

Blazor "session" storage #19715

mrlife opened this issue Mar 9, 2020 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@mrlife
Copy link
Contributor

mrlife commented Mar 9, 2020

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 it

Is 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:

  • HTML5 localStorage or sessionStorage but no locatable, built-in way to implement them via ASP.NET Core/Blazor
  • ConnectionContext.Items, which I couldn't get to work due to DI errors
  • adding actual ASP.NET HttpContext session to _Host.cshtml.cs, which is a limited workaround
  • using a ClaimsPrincipal, 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.

@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Mar 9, 2020
@boukenka
Copy link

boukenka commented Mar 9, 2020

There is a protected browser storage #18755 planned for 5.0.0-preview2 requested by @danroth27.

@mkArtakMSFT
Copy link
Member

Thanks for contacting us, @mrlife.
As @boukenka has pointed out, the referenced issue will cover this.

@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Mar 10, 2020
@ghost ghost added the Status: Resolved label Mar 10, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants