> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/zmienne-sesyjne/zarzadzanie-zmiennymi-sesyjnymi.md).

# Managing session variables

## Session variables panel

The view for managing session variables is the panel **Session variables**. To open it, select the option in the left menu **Session variables**. On the right side of the panel title bar there is a magnifying glass icon that allows searching the list of variables.

![Figure 1. "Session variables" panel](/files/e11be39384a41fada264453164536bf79e278899)

### Adding a new session variable

Adding a new session variable is done by pressing the button **Add session variable**.

In the new row added at the very top of the panel, we fill in:

* **MID** - variable key
* **Default value** - constant variable value
* **Service ID** - after attaching the session variable to the service, the name of that service will appear here
* **Output parameter** - if the session variable is an output parameter of the service, it will be specified here
* **Exposed** - we mark whether the given session variable should be passed to the client **explicitly**. This option allows the session variable to be used in conditional expressions and formatters executed on the client side. If the session variable has its box unchecked, it is not sent to the client.
* **Gtm**
* **GTM tag** - GTM tag name
* **Statistics** - enabling the option to send the variable value to statistics.

![Figure 2. Row for creating a session variable](/files/1e5fb9464136a1ac1d8bd5dccbe6bad6850015b7)

After leaving the name field, the variable is created. If no name is defined for the variable, the system will automatically assign the value "empty" or a copy of that value if it already existed.

### Editing an existing session variable

To edit an existing variable, just click in the column **MID** and change the value.

### Service output definition

A session variable can be used as a place to store the result of executing a service defined within any page of the current request.

We define the mapping of the variable to the appropriate service output field in the panel **Page services**, which we open by clicking the button **Page services**:

![Figure 3. List of services available in the request, displayed after clicking the "Page services" button](/files/29f52229e3eb4c5a9df4804859d9534c4bfab81e)

Once the list of services available for the request appears, we look for the correct service, and then reveal its details by clicking the option located on the right side of the panel **Show details**. Mapping the service output to a variable will be possible after clicking **Output parameters** in the displayed details:

![Figure 4. Expanded details for PageService1](/files/7ba149590597de774ce2b73361c6d923a2add6af)

In the output parameters tab, click the button **Add parameter** — this will display a row in which first, in the column **Request component**, we select the session variable for which we want to map the output, and then in the column **Output parameter**, we indicate the appropriate output:

![Figure 5. In the "Output parameters" tab, a session variable was selected,&#x20;
for which the output parameter still needs to be selected](/files/fb084198712fc86612819981b2672707ad2616f0)

After correctly attaching the service to the variable, its properties will contain information about the attached service and the indicated output parameter:

![Figure 6. In the session variables panel, for the variable with an attached service, its name is in the "Service ID" column, and next to it the output parameter from the service](/files/b97dcc5b397368e73bab0209e74940a7e9651dfd)

### Deleting a session variable

A session variable is deleted by selecting the trash icon available after hovering over the row of that session variable. Attempting to delete a session variable used in an artifact (e.g. as a service input parameter or listening on a variable) will result in an informational message:

![Figure 7. Tooltip with information that a session variable cannot be deleted](/files/2ef23b7df6189c5f881104f0c7993852d4e8bb1e)

### Using a session variable to determine a component's initial value

To use a session variable to determine the initial value of a given element, perform the following steps:

* select the component
* in the list of available properties, search in the Interactions section for the property **DATA SOURCE FROM ANOTHER FIELD**
* after clicking in **Choose a component or constant** we can choose the MID of the session variable that is to serve as the default value of this element,
* additionally, listening to the variable must be added according to the instructions in: [Listening and clearing](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/dynamicznosc-formularza/nasluchiwanie-i-czyszczenie.md)

### Using a session variable to retrieve a component's value

For the session variable, select the EchoService service added on the request page.

### Examples of using a session variable

* Using a session variable in a condition: getValue("@zmienna1")=="Y" where zmienna1 is the variable name
* Using a session variable in the Label component: Current value of the variable is ${zmienna1} where zmienna1 is the variable name

{% hint style="warning" %}
Note!

1. If we use the session variable in a compound component, we need to add the @ symbol before its name (we do not use this notation for predefined variables).
2. Session variables cannot be used in [Repeatable section - RepeatableSection](https://github.com/Consdata/eximee-docs/tree/main/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/sekcja-powtarzalna-repeatablesection.md) — here we use technical fields.
   {% endhint %}

{% hint style="info" %}
Demo request: demoZmienneSesyjne
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/zmienne-sesyjne/zarzadzanie-zmiennymi-sesyjnymi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
