Hi Community,
I am encountering an issue with session invalidation when a user logs into our Reactive Web App from multiple devices.
Environment Details:
Platform Version: OutSystems 11 (Reactive Web)
Environment: Staging (1 Front-End Server, 1 Back-End Server)
Scenario / Steps to Reproduce:
User A logs in to the Reactive Web Application on Laptop 1.
User A subsequently logs in to the same application on Laptop 2.
On Laptop 1, as soon as the user triggers the next Server Action, Data Action, or Aggregate, the request fails.
Service Center logs a Role required security exception for Laptop 1's request.
Current Implementation & Observations:
Upon successful login, custom roles are granted programmatically using GrantRole.
These roles are configured as Persistent Roles (Is Persistent = Yes).
I am using the Outsystems user action 'User_Login' when a user login to the application
Questions:
Is this standard platform behavior where User_Login invalidates active security tokens across other active browser sessions for the same user ID?
What is the recommended architectural pattern if we want to allow concurrent sessions without kicking out the first device?
Yes, what you’re seeing matches the standard behavior of the OutSystems Users module and the platform’s security model in O11:
User_Login
This is effectively the “single active login token per user” behavior that people observe when trying to use the same user on multiple browsers/devices. It’s not configurable via a toggle – it’s how the built‑in authentication works today in O11. Number of concurrent logins and how outsystem handles if it reaches the limit
The fact that you are granting persistent roles (Is Persistent = Yes) is orthogonal: persistent roles just mean that, once granted, the roles survive across sessions/logins. They don’t change the “single active security token per user” behavior.
So, answer to Q1: Yes, calling User_Login for a user effectively invalidates existing security contexts for that same user, which is why the first device starts failing with security exceptions.
You essentially have two options, depending on how far you’re willing to move away from the built‑in Users login.
If hard concurrency (same user, multiple devices simultaneously) is not a strict requirement, the simplest is to:
This doesn’t give true concurrent sessions, but it avoids a “mysterious” error and gives a controlled UX.
If you must support concurrent sessions, you need to implement an application-level session model and avoid triggering a fresh User_Login in a way that invalidates the previous token.
Technically, the Users module still only supports one active security token per user; you can’t configure multiple independent tokens per user. What you can do is:
Minimize calls to User_Login
Store application sessions in your own entity Create an entity, for example UserAppSession, with fields such as:
UserAppSession
Id
UserId
SessionId
GetSessionId()
DeviceInfo
Browser
LoginDateTime
LastActivityOn
IsActive
On login:
IsActive = True
Decide your concurrency policy
You have two common patterns:
IsActive = False
Key point: the “kicking out first device” effect happens when User_Login is called again; so you must only call User_Login on the first authentication per browser and avoid re-calls.
For completeness: if you ever want to prevent multiple concurrent sessions (user can only be logged in from one device), you implement:
OnBeginWebRequest
GetUserId()
Logout()
This is exactly the pattern described by community members for implementing “no concurrent login” logic. Disable Concurrent Logins from the Same Account
You don’t want this pattern in your current scenario, but it’s good to know because the behavior you have today (user losing token on second login) is conceptually similar.
Given your scenario:
Symptom: First device gets a “required security exception” as soon as you log in from a second device and trigger a new request.
Likely causes:
Steps to fix / enable concurrent sessions:
Ensure User_Login is called exactly once per browser login:
Keep your role assignment separated from User_Login:
Test with two devices / browsers:
User_Login(UserIdA)
If after ensuring a single call to User_Login per browser you still see the first session being invalidated, then you’re hitting a limitation of the current Users module authentication model, and the only way forward is to:
Summary
I don't think User_Login invalidating other sessions is standard behavior. In O11 the same user can normally be logged in on several browsers at the same time, that's why there are Forge components like No concurrent login (https://www.outsystems.com/forge/component-overview/17561/no-concurrent-login-o11) built specifically to block it.
Since the error is a Role exception and not a redirect to login, it might be something in your login flow removing the role, for example a RevokeRole before the GrantRole, or some cleanup logic that runs on each login. Can you check if the user still has the role (Users app > user detail) right after logging in on Laptop 2? If the role disappears there, that's probably it.