Use the OnSessionStart action to handle the System event that occurs in the following situations:

As an example, you can design this action to prepare session variables of the eSpace after an end-user logs in to the application.

You're allowed to design the OnSessionStart action in any eSpace of your application and this way handle this System event in the context of each eSpace. The OnSessionStart action is executed once an element of the eSpace is used by the application: a web screen, an action, etc. If there's no usage this action is not executed.

The OnSessionStart action has no input parameters nor output parameters but you can create local variables.


There are a couple of remarks to be made regarding the OnSessionStart action:

  1. Because Web Services and Timers don't create sessions, the OnSessionStart action is not executed when accessing these elements;
  2. With eSpace references, the OnSessionStart is executed once an element exposed as public is used by another eSpace.

Single Sign-On Scenario

In a Single Sign-On scenario the session is shared among all of the unified eSpaces: the User Provider eSpace and User Subscriber eSpaces. In this case, the OnSessionStart action of the User Provider eSpace is executed before executing the OnSessionStart action of a User Subscriber eSpace.

Persistent Login

If you're using Persistent Login and an end-user is implicitly logged in to the application, the UserId and the persistent Roles for that end-user are already loaded when the OnSessionStart action is executed.

See Also

About Requests | About Sessions in OutSystems Platform | Single Sign-On | Persistent Login | Overview of System Events