1

I have an existing webforms applications which logs the SessionId ,I am converting the entire appplication to blazor and was wondering if there was an equivalent of this session id??

IYM
  • 11
  • 1
  • Take a look at https://www.syncfusion.com/faq/blazor/general/how-do-i-store-session-data-in-server-side-blazor AND https://docs.microsoft.com/en-us/aspnet/core/blazor/state-management?view=aspnetcore-6.0&pivots=server AND https://stackoverflow.com/questions/53913396/how-to-store-session-data-in-server-side-blazor AND https://tutorialslink.com/Articles/How-to-use-Sessions-in-Blazor-Application/2057 – AliNajafZadeh Jan 02 '22 at 14:18
  • What flavor of Blazor ? WebAssembly App or Blazor Server App. Have you ever created apps with Razor Pages App ? What do you need the "Session.SessionId" for? You must get rid of bad habits acquired through the use of WebForms. I'd advise you not to attempt to convert a Webforms page into a Blazor pages as though you were translating an English phrase into Hebrew. I saw such funny attempts (very often with google translate). Hope you got me. בהצלחה – enet Jan 02 '22 at 16:20
  • Server App, my companies websites is currently in webforms and we are looking move to .netcore and blazor we use the session Id to track user activities, And I totally agree with your google translate analogy not at all I good idea (Ive found out the hard way ;) ) – IYM Jan 03 '22 at 09:38
  • Welcome to the true world of the Internet. You are no longer shield by the WebForms framework. You can track user activities in various ways, depending on the context... In Blazor Server App, the user's state is held on the server in a Circuit object, which is created for each instance of the App. That is, if you open a second tab of the app, a second Circuit object will be created on the server. A Circuit object exposes an `Id` property, so you can associate a given user with circuits (active instances of your web site). – enet Jan 03 '22 at 18:36
  • See this answer https://stackoverflow.com/a/60004725/6152891 to start investigating the subject... Note that this is an advanced stuff. If you are interested, I can provide some consultation and even coding, in return for donating 18 shekel per hour directly to this charity https://www.israelgives.org/amuta/580352185 You may find my email in my profile window... – enet Jan 03 '22 at 18:36
  • Thank you so much!! I will definitely take you up om that offer if the opportunity arises : ) – IYM Jan 05 '22 at 14:23
  • The circuit Id seems to be a good option ,problem is that it changes after refresh... – IYM Jan 05 '22 at 15:09
  • There are ways to deal with this, depending upon your requirements. As for instance, you can create a Concurrent Dictionary whose key is an authenticated user's identifier, to store references to the circuits. In order to solve an issue you need to face it first, and then seek solutions. קוראים לי איציק ואני גר בבאר שבע. להשתמע... – enet Jan 05 '22 at 20:24

0 Answers0