13
Views
2
Comments
why onSessionStart runs twice
Discussion

In my application OnSessionStart runs twice, once when opening the login page and the another one when calling the login action ?

can I prevent the first call and keep only the one when logging in the user ?

Rank: #287

HI Muhamed


The url below is the official document about the session start event.

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Traditional_Web/Web_System_Events/On_Session_Start

Action to be executed in the first request to the server, after logging in, or on the first request after having logged out.

It explains why it's trigger twice.

Kindly Regards

Champion
Rank: #377

Hi Muhamed,

You need to check if a user is logged in. That's the second time OnSessionStart is triggered. The event is triggered for the second time *after* the user logged in, so just check GetUserId().

Regards,
Lennart