How is your experience with the OutSystems Community?
28
Views
5
Comments
Concurrent Session Control (Duplicate Login Prevention) on OutSystems
Question

Hello,

We are currently using OutSystems in production and have encountered a technical issue related to concurrent session (duplicate login) control. Given the urgency of this matter, we would greatly appreciate your prompt guidance.

Issue

Concurrent session control is not working as required. Our requirement is:

  • Only one active session should be allowed per account.
  • Example scenario: If Device A is already logged in and Device B attempts to log in with the same account, the user should receive an alert/confirmation message on the new device (Device B) indicating that another session is already active.
  • Additionally, we need to define the expected behavior for which session should be retained (e.g., whether Device A's session is terminated, or the login on Device B is blocked until confirmed).

Environment

  • OutSystems Version: 11.55.77
  • Architecture: React-based web application, wrapped and deployed as a mobile app

What We Have Already Tried

  • SingleUserSignIn (Forge component): We found this to be unusable, as it caused bugs when used across multiple modules.
  • ConcurrentSessionControl (Forge component): This component forcibly terminates the existing session on Device A when a new login occurs on Device B, which does not match our intended behavior (we need a confirmation-based flow, not a forced termination).

Related Consideration – WebSocket

As part of our investigation into implementing real-time session notifications (e.g., alerting Device A when a new login attempt occurs on Device B), we also reviewed the previous guidance suggesting a WebSocket-based approach. Based on our technical review, it appears that OutSystems does not natively host a WebSocket server endpoint. Implementing WebSocket would require either:

  1. Setting up a separate external WebSocket server, with OutSystems integrating via REST, or
  2. Introducing an intermediate layer (e.g., a dedicated backend, proxy/gateway, or message broker) to handle WebSocket traffic.

Currently, we do not have the infrastructure in place to support a dedicated WebSocket server, and building one would introduce significant additional operational overhead (deployment, scaling, failover management, etc.), which is difficult for us to accommodate given our current resources.

Our Request

  1. Is there a way to achieve the required concurrent session control (real-time notification and session confirmation) without setting up a separate WebSocket server — for example, using REST polling, Server-Sent Events (SSE), or another mechanism within the existing OutSystems architecture?
  2. If WebSocket is genuinely required to meet this requirement, we would like to explore alternative approaches instead, given our infrastructure constraints.
  3. We would also like your input on two potential approaches we are considering internally:
    • Rebuilding/customizing the SingleUserSignIn Forge component to resolve the multi-module bug issue, or
    • Separating the infrastructure environment while keeping a single OutSystems (Hanatour) domain/account, to see if this would resolve the conflict that caused the original SingleUserSignIn issue.

Urgency

This service is already deployed and actively used by field users in a production environment. Additionally, this requirement has been escalated internally by our Security team as a priority item that needs to be addressed as soon as possible. We understand this is a request specific to our internal circumstances, but we would sincerely appreciate your expedited review and guidance so we can move forward quickly.

Thank you very much for your support, and we look forward to your response at your earliest convenience.

2026-06-05 12-38-17
Eduardo Jauch

Hello @ej ryu 

At start you said you wanted to alert the NEW device, but then, when talking about web sockets you mentioned receiving the alert in the original device.

For the first scenario, you probably can change the code of ConcurrentSessionControl to return a warning to the new device instead of terminating the older session. The change shouldn't be hard to make.

For the second scenario, I recommend reading this article: https://medium.com/darwinlabs/using-webhooks-with-server-sent-events-in-outsystems-cd0506af38c9

But bear in mind that if you want to allow the user to decide, from the original device, if they want to allow the login in the new device (terminating the login in the old device), you will have to change the way the login is made and the timeouts, as the new login will have to, somehow, wait for the other device to tell this.

Particularly, even in terms of security and implementation simplicity, I would prefer a "no other logins allowed". But if this is a requirement and the client can't be convinced otherwise, there is some more work to be done.

Hope this helps.

Cheers.


2022-11-15 09-46-15
Rituraj Chouhan

Hi @ej ryu,

Well this can be achieved with a straight forward approach as well. 

Like, have an entity for session with following attributes.

Id

UserId 

Device Info

IPAddress

LoginInTimeStamp

IsActiveSession.


Login flow

  1. Validate credentials as normal.
  2. Get Session where UserId = X and IsActiveSession.
  3. No active session found → create a new Session record set IsActiveSession true, proceed with normal login.
  4. Active session found → do not log in yet. Return the existing session's DeviceInfo/LoginTimestamp to the client.
  5. Client shows a confirmation dialog: "An active session exists on [device] since [time]"
  6. User Informed → abort, stay on login screen.


Hope this helps you.

 

2019-01-07 16-04-16
Siya
 
MVP

@Rituraj Chouhan : Your suggestion is useful for detecting duplicate logins and blocking a new login when an active session already exists. However, it does not fully address the original requirement, which is to notify the existing device in real time and let the user approve or reject the new login attempt before deciding which session should remain active.

2022-11-15 09-46-15
Rituraj Chouhan

Hello @Siya , I believe notifying device A was not the requirement, it's just an alternative they were thinking of in terms of Related Consideration such as WebSocket etc. for a solution.

2019-01-07 16-04-16
Siya
 
MVP


You are right. I was looking at the broader discussion where they were also exploring a confirmation-based flow. Your approach addresses the duplicate login detection requirement, but if they decide to support an approval/takeover workflow in the future, it would need an additional real-time notification mechanism, such as Firebase Cloud Messaging (FCM)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.