π Enforce Single Active User Sessions in OutSystems with Concurrent Session Control
β Available on OutSystems Forge Β π Concurrent Session Control (O11)
π Enforce Single Active User Sessions in OutSystems with Concurrent Session Control
β Available on OutSystems Forge π Concurrent Session Control (O11)
π Introduction
Many business-critical applications require users to have only one active session at a time. Whether for security, licensing, or data integrity, enforcing this rule can protect your system from misuse or unauthorized concurrent access.
Thatβs why Iβve developed the Concurrent Session Control component β now available on OutSystems Forge. This plug-and-play solution helps developers enforce single-session behavior in any OutSystems Reactive Web App with minimal configuration.
π§ Why Concurrent Session Control?
By default, OutSystems allows users to log in from multiple devices or browsers at the same time. But this behavior is not always desirable in environments such as:
- Banking and financial systems
- E-learning platforms
- Enterprise admin dashboards
- Government and compliance-driven apps
These systems often require tighter control to prevent:
- Account sharing
- Session hijacking
- Inconsistent data updates
- Breach of license limits
π§© What the Component Does
The Concurrent Session Control component handles:
- Token Generation: Upon login, a unique session token is created.
- Session Storage: The token is stored in an entity (
ExclusiveUserSession) with timestamp and user ID. - Session Invalidation: If a token already exists for that user, it is replaced.
- Client-Side Validation: A timer on the client continuously checks if the stored token is still valid.
- User Sign-Out: If the token is no longer valid (i.e., user logged in elsewhere), the current session is terminated with a notification.
βοΈ Key Features: Concurrent Session Control
ποΈ Entity: ExclusiveUserSession
π Purpose: Stores session-related data π§βπ» Fields: π€ User ID π Token π Token Generation Time & Expiration Time
π§© Actions
π GenerateUserTokenWithSingleSession
π― Generates a unique session token for the user π« Ensures only one active session per user at a time
β
ValidateUserToken
π Checks whether the stored token is still valid π Prevents usage if the token has expired or is invalidated due to a new login
βοΈ Site Properties
π UserTokenValidityDurationMinutes π οΈ Default Value:
180minutes β±οΈ Controls how long the generated token remains valid π§ Can be customized based on security requirements
π§Ύ CheckTokenExpiration π A flag to control whether the system should validate token expiration π Used to compare the tokenβs expiration
DateTimeagainst current server time β Type:Boolean
π§ͺ Demo Flow Included
A ready-to-use implementation that demonstrates:
πΎ Storing the token in a Client Variable
Variable Name: UserToken
π Using On Application Ready to:
π Validate the token every few seconds
β Redirect users to the logout screen if their session becomes invalid
π οΈ How to Use It
[1] π§ Add Client Variable to Store the Current Token
π¦ Client Variable Name: UserToken
π§Ύ Type: Text

[2] π Modify Your Login Logic to Call GenerateUserTokenWithSingleSession
π§© After a successful login, call the **GenerateUserTokenWithSingleSession** action to issue a unique session token for the user.

[3] πΎ Store the Generated Token in a Client Variable
π§© After calling GenerateUserTokenWithSingleSession, store the returned token in a client variable named UserToken.

[4] π Create OnApplicationReady Event

[5] π§ͺ Token Validation Strategy
β
Use ValidateUserToken on application load
π Also call it periodically using setInterval() in JavaScript
π§ Important Check:
Before executing the validation, ensure the user is not anonymous and the UserToken exists to avoid unnecessary processing.

[6]πͺ Log Out User if Token is Invalid
π§ͺ This logic should run inside the OnApplicationReady loop (or setInterval) after calling ValidateUserToken.
β Steps:
- π Call
ValidateUserToken - π Check the result
- If the token is valid, do nothing
- If the token is invalid, proceed with the following steps
- β οΈ Show notification message to the user (e.g., βYour session has expired. Please log in again.β)
- πͺ Log the user out
- π Redirect to the login screen

All steps are documented clearly in the Forge component.
πΌ Use Cases
- Financial Apps: Prevent multiple simultaneous logins for the same user.
- Admin Portals: Limit per-user access for license control.
- Online Exams: Ensure a test-taker canβt access from multiple devices.
π₯ Download & Documentation
You can install the component and view full setup instructions here: π Concurrent Session Control on Forge
π§ Final Thoughts
Managing user sessions is essential to application security and user experience. With this component, you can enforce single-session policies easily in OutSystems without reinventing the wheel.
If youβre building secure apps with OutSystems, this tool can help you simplify session logic and strengthen your authentication strategy.
λ©νλ°μ΄ν°
- post_id
- 8eaab2b682bf
- slug
- enforce-single-active-user-sessions-in-outsystems-with-concurrent-session-control-8eaab2b682bf
- url
- https://medium.com/@kiroadel/enforce-single-active-user-sessions-in-outsystems-with-concurrent-session-control-8eaab2b682bf
- canonical_url
- https://medium.com/@kiroadel/enforce-single-active-user-sessions-in-outsystems-with-concurrent-session-control-8eaab2b682bf
- author_url
- https://medium.com/@kiroadel
- status
- ok
- fetched_at
- 2026-06-25 12:15:08