Session variables hold data that is persisted during the session and can be used to save information during the end-user interaction. Each application has several session variables automatically created, but you can define new ones.

Session Variable lifetime

The session variables are initiated automatically by Service Studio when the Platform Server session is created. While the session exists, you can use these variables in your business logic. When the session ends, the session variables are set to their default value.

Pre-defined Session Variables

Each application has several session variables that are automatically created and read-only:

Read only.

Read only. Phone number type.

Read only.

Read only. Text type.

Read only.

User-defined Session Variables

You can define your own session variables. To define a session variable, simply right-click on the Session Variables folder (in the eSpace tree under the Data layer), and select the Add Session Variable option.  Session variables, just like screen variables have an associated data type and a default value that can be set through the session variable properties. Learn more about session variables data types.

Session variables should be used with care since they can affect the scalability of your applications. You should try to avoid storing large quantities of data with session variables because, in each request, these variables need to be fetched from the database and then, when the request ends, updated in the database. When Service Studio detects you are compromising the application's performance and scalability, a warning message is displayed.

When the end-user logs in or out, using the Login, LoginPassword, or Logout actions, the session variables are set to their default value.

What you Should Know

Asynchronous logic such as sending Emails, Timers execution, Processes execution, and Web Services run on a different session, meaning that all session variables are set with their default value when the logic is executed.

Session Variables Properties




Default value



Name of the Session variable.



See rules for naming elements.


Free text that describes the variable. You can edit the text by directly typing it in the property or in the description editor which opens by clicking



Useful for documentation purpose.

The maximum size of this property is 2000 characters.

Data Type

List of all the types supported by Service Studio but Object type. In this list you'll also find the Identifiers of all the entities of the Space.



See list of possible types

Default Value

Default value for the session variable.



The default value of a session variable must be a literal.

See Also

About Variables | About Sessions in OutSystems Platform