Re: Flowing-State-in-Blazor-8 #3537
-
@rockfordlhotka For years (too many to admit) I've enjoyed checking in regularly on your blog and finding road signs that let me know what is coming in the near future that may be of concern to me and other LOB app devs. I wanted to add a thought related to your solution. Indeed, you already mentioned a slight concern about using a sessionid cookie. One of the REALLY huge benefits that we've realized by using Blazor Server Side (?Server Interactive?) is that there is no SessionID cookie. Unlike ASP.Net WebForms - each browser tab gets it's own independent Circuit. This allows each Browser Tab to act completely independently of other tabs. Now it is possible to have:
As you know cookies are a cross-tab resource. I recently verified this by having one user login with multiple tabs while using the Azure Load Balancer solution with session affinity turned on. The Azure load balancer puts a cookie on the browser and all the tabs pointing to the site get sent to the same server. So my long winded point is that requiring the use of a session cookie would cause the (perhaps unintended) side effect of all browser tabs sharing the same session. With your idea still in draft, I figured I'd put this bug in your ear as this is maybe some unique use of blazor server side that you hadn't thought of. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Thanks @swegele! There is a cookie scope that is per-tab, and that's what I'm using in the I've explored some other ideas around maintaining a session id value that is consistent in server-rendered, server-interactive, and wasm-interactive, but a cookie appears to be the only answer. |
Beta Was this translation helpful? Give feedback.
I think that's something the app developer would need to choose up front, because only they will know if they are including any server-rendered pages in their app.
In the (new) default template for a Blazor App you get all three.
Home
is server-rendered, as is the weather page (plus streamed content). TheCounter
page starts as server-interactive and switches to wasm-interactive - potentially while the user is sitting on the page!