Shared State between Site, Modules, Themes #760
-
In our enterprise site, folks can switch between "conferences" whimsically as they are running the admin site. So one admin site allow context switching. We'd like to keep a "conference id" tucked away for each user session. Is there a place in the site to store session data or should we roll our own session mechanism that is available to the Theme and every Module in a site? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
One option is to store the conferenceid as a UserSetting. Then you would be able to retrieve it anywhere within the site. However this would only work if users are authenticated. Another option is to use a cookie. Or a Querystring parameter. |
Beta Was this translation helpful? Give feedback.
-
we are using https://github.com/Blazored/SessionStorage so the data is pinned to the tab, and not the user. Now I'm configuring the service in the Theme (as opposed to a module) using IClientStartup. It's super simple to share UI data between the theme and the modules this way. |
Beta Was this translation helpful? Give feedback.
we are using https://github.com/Blazored/SessionStorage so the data is pinned to the tab, and not the user. Now I'm configuring the service in the Theme (as opposed to a module) using IClientStartup. It's super simple to share UI data between the theme and the modules this way.
_confName = await SessionStorage.GetItemAsync<string>("confName");