# Session Variables

Session Variables provide a mechanism to store user data between HTTP requests and to share user data across browser tabs. Use Session Variables to save:

1. Values that are re-used
2. Values that are no longer needed when users log out

Stadium provides the following data in read-only session variables

1. ID (user-specific GUID)
2. Name (string)
3. Email (string)
4. Roles (list of strings)

**Usage**

Adding session variables

1. Click on the Application to open the Application Properties
2. In the “Session” section of the Application Properties, open the “Variables” collection editor to add or remove session variables

![](/files/oedMPNGG3sXiA9YIzTB6)

Assigning Values to Session Variables

1. Add a "SetValue" to a script or event handler
   1. Target: Select the session variable from the dropdowns
   2. Source: The value you wisht o assign to the session variable

![](/files/5u5LU1euWH0iYat8aGhG)

Using Session Variables

1. Use session variables by selecting them in the “Session” category in property dropdowns in the properties panel

![](/files/ac3OxAeOrLPsyKnkWjYF)

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stadium.software/features/sessions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
