Skip to content

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

Closed
SeppPenner opened this issue Jul 22, 2019 · 6 comments
Closed

Question: How to use sessions correctly in Blazor? #12432

SeppPenner opened this issue Jul 22, 2019 · 6 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components Docs This issue tracks updating documentation Done This issue has been fixed task

Comments

@SeppPenner
Copy link

Question

How can I use sessions in Blazor correctly? The answers I found:

My question now: What's the way to go with Blazor?

@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Jul 22, 2019
@mkArtakMSFT
Copy link
Member

Thanks for contacting us, @SeppPenner .
We don't have a blazor-native way for interacting with Session.
@anurse does SignalR provide any guidance regarding using sessions?

@mkArtakMSFT mkArtakMSFT added this to the 3.1.0 milestone Jul 22, 2019
@analogrelay
Copy link
Contributor

No, we don't have specific guidance. The HttpContext.Session object is certainly not guaranteed to work properly.

@mkArtakMSFT mkArtakMSFT added enhancement This issue represents an ask for new feature or an enhancement to an existing one and removed investigate labels Jul 22, 2019
@SeppPenner
Copy link
Author

The HttpContext.Session object is certainly not guaranteed to work properly.

I already experienced that 😄

@mkArtakMSFT mkArtakMSFT added Docs This issue tracks updating documentation task and removed enhancement This issue represents an ask for new feature or an enhancement to an existing one labels Aug 5, 2019
@mkArtakMSFT mkArtakMSFT modified the milestones: 3.1.0, 3.1.0-preview1 Aug 5, 2019
@guardrex
Copy link
Contributor

guardrex commented Aug 7, 2019

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.

@mv10-work
Copy link

Related: #5330

@javiercn
Copy link
Member

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).

@javiercn javiercn added the Done This issue has been fixed label Sep 23, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components Docs This issue tracks updating documentation Done This issue has been fixed task
Projects
None yet
Development

No branches or pull requests

6 participants