Session Variables
Last updated
Last updated
Session Variables provide a mechanism to store user data between HTTP requests and to share user data across browser tabs. Use Session Variables for:
Values that are re-used while users are logged in
Values that are no longer needed when users log out
Stadium provides the following data in read-only session variables
ID (user-specific GUID)
Name (string)
Email (string)
Roles (list of strings)
Session Usage
Adding session variables
Click on the Application to open the Application Properties
In the “Session” section of the Application Properties, open the “Variables” collection editor to add or remove session variables
Assigning Values to Session Variables
Add a "SetValue" to a script or event handler
Target: Select the session variable from the dropdowns
Source: The value you wisht o assign to the session variable
Using Session Variables
Use session variables by selecting them in the “Session” category in property dropdowns in the properties panel
Session Storage
Stadium uses ASP.NET sessions, which are stored server-side so that browser tabs that share a session can get access to the same data. Session data is retrieved via a WebService call when the application is loaded and is stored client-side until the application is reloaded. When applications update session data, a call is made to the server to update the session data.
Limits
There is no limit as to the type of data or to the amount of data that can be stored in a session. However, as session data is stored in RAM on the server and on client machines, storing large amounts of information can slow down either or both machines and even lead to crashes. It can also take time to fetch, load and update session data. So, best practice is to store as little as possible in the session.
Timeouts
Session timeouts can be set per application in the Stadium Application Properties. If users don’t interact with an application for the duration of the timeout, the user is logged out and the session values are wiped. When users interact with the application, the timeout counter is set back to that timeout value.