280
Views
4
Comments
Solved
Session login/logout
Question
Application Type
Reactive

    I have a scenario where a user must be automatically logged out when logging in from another browser . For example: I am logged in Chrome and now I am logging in Incognito. At this moment, I should not be able to login in Incognito.

2024-06-12 08-10-25
Zeeshan Khan
Solution

Hello Priya, 

You'll have to manage user sessions and implement a logic to track active sessions per user. OutSystems provides built-in session management functionalities. You just need to leverage this to track active sessions for each user. 

Or

You just need to create a session entity in your OutSystems application database to store session information, including user ID, session ID, login timestamp, and last activity timestamp now before allowing a user to log in, query the session entity to check if there are any active sessions for the user if there are active sessions, invalidate those sessions by deleting the corresponding records from the session entity now just simply implement a mechanism to periodically check for inactive sessions and remove them from the session entity to prevent the database from growing indefinitely. 

Hope this will help you...

Thanks

2023-11-22 10-51-50
Jozy Sohail

Hi Priya,

This post is having a same discussion with solution, try this.

https://www.outsystems.com/forums/discussion/77210/logout-user-in-seperate-browser-reactive/

Hope it helps.

Thanks.

2023-02-09 12-36-42
Damian Fonville

Hi,

In the past we had trouble that when a users logs out all sessions are invalidated, Si your logout everywhere. See also this idea. https://www.outsystems.com/ideas/12761/logout-should-not-terminate-all-sessions-of-the-user-on-multiple-devices/ 


What you could try is to make a flow that uses 

  1. Login 
  2. Logout -> This should invalidate all sessions
  3. Login -> Login the user again on the current device.

This is not the best way, but it maybe the only way right now.


I saw there was an idea on this topic, you can vote on this, https://www.outsystems.com/ideas/8891/autologout-other-session-for-the-user/ 

2024-06-12 08-10-25
Zeeshan Khan
Solution

Hello Priya, 

You'll have to manage user sessions and implement a logic to track active sessions per user. OutSystems provides built-in session management functionalities. You just need to leverage this to track active sessions for each user. 

Or

You just need to create a session entity in your OutSystems application database to store session information, including user ID, session ID, login timestamp, and last activity timestamp now before allowing a user to log in, query the session entity to check if there are any active sessions for the user if there are active sessions, invalidate those sessions by deleting the corresponding records from the session entity now just simply implement a mechanism to periodically check for inactive sessions and remove them from the session entity to prevent the database from growing indefinitely. 

Hope this will help you...

Thanks

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