How to restrict a user to login in only one time - cannot login from other computer or to open a new tab?

regards and thank you,


Hi Barong,

You can write your own logic, on login you can check if the user is already logged in or having an active session and if you found a record show him some message or redirect him to anywhere you want.



Hi Barong,

One thing you can do, You can create a one child table for User table with Column as Is_Login. Set the value as true while login for first time. Please check the value every time if you are login from another device. If value found true you can popup an error. 

I hope it should work!!





You have to remember that if you store the information about if a user has logged in to determine if he can or not login again from another device/browser, you will have to guarantee that when the user logs out by himself or because the session timed out, you will have to update the information, or the "only one time" as in "one once at the same time" will become "only one time" as in "never more"...

So, if you don't want to use the system tables that contain the information about logins, and I think for this use case maybe you should take a look on them, you will need to setup logic for this to happening.

A first approach from the top of my mind is to use not only a field to indicate if the user is logged in, but also the date/time of the last user interaction with the server.

When verifying if the user can login, you can check this last time and if the time is older than the session timeout, you can allow, otherwise you didn't.

But this will require of you to update this information on every screen action in the entire application.

Also, you will have to take care of the Logout logic, so that if the user explicit logout, you update the information.

I would think twice before implement something like this. Even using the system tables.

The question that I would do is the following: Is this REALLY a real requirement for my application?
So, if you can provide more details on WHY you wants to do that, we could think of alternatives. 

Eduardo Jauch