160
Views
3
Comments
Prevent two logins from same user

Hi everyone,

I have a requirement to prevent the same user to log in two different sessions. 

I think there's no way of doing this using just what OS actually have (API's, configs, etc). 

I thought of having a control table with a map between userId and sessionId and populate the table when a user logs in the app. But then in the 2nd login I would have to check wether the first session is still active to allow or not the login being made and that's where I'm stuck.

Any thoughts on this?

2022-02-07 08-52-30
Pranav Pandey

Hi Bruno Marques,

So here before logging a user in, you need to check if the user has an active session or not. For that keep track of userId and its active session. Please see the below discussions for reference.

Discussion1

Discussion2

2019-08-28 11-43-22
Bruno Marques

But how do you check if a session is active?

UserImage.jpg
Louis Vally

Hi Bruno,

Did you get an answer? How to now if the session is active.


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