Hi,

I am working on a project on which it is possible to log in the system with the same account at the same time from different browsers or with a normal session and an incognito one. I have a requirement where when someone logins in a second browser, the first browser should log out the user in the first browser. Is this achievable in Outsystems? If so how? Also, if this is not possible, what is the best approach in order to just notify that the user is already login in another browser and restrict the second login?

Thank you!

Sure. When the user logs in, set a flag on a table. If they try to log in again and the flag exists stop them. You would need to handle session timeouts, etc..

Stacey Levine wrote:

Sure. When the user logs in, set a flag on a table. If they try to log in again and the flag exists stop them. You would need to handle session timeouts, etc..

Thank you! Is any possibility in Outsystems to automatically log out the user when logging in the second time from another browser/computer?


Mihaela Vasiu wrote:

Hi,

I am working on a project on which it is possible to log in the system with the same account at the same time from different browsers or with a normal session and an incognito one. I have a requirement where when someone logins in a second browser, the first browser should log out the user in the first browser. Is this achievable in Outsystems? If so how? Also, if this is not possible, what is the best approach in order to just notify that the user is already login in another browser and restrict the second login?

Thank you!

Hi Mihaela Vasiu,

 1).First You have add attribute(Single user) to your entity(Boolean) default value=False.

2).Login Action Check Condition- Check Particular User Login

SyntaxEditor Code Snippet

GetExtrasByUserId.List.Current.Extra.SingleUser=False

Follow the last Image.

3).Under Do login Assign Statement - Enable Login

SyntaxEditor Code Snippet

GetExtrasByUserId.List.Current.Extra.SingleUser=true

Create or Update that Particular Entity.

4).Client logout

Assign under DOLOGOUT action 

SyntaxEditor Code Snippet

User.SingleUser=False

 follow the above picture.


Ramesh Kannan.v wrote:

Mihaela Vasiu wrote:

Hi,

I am working on a project on which it is possible to log in the system with the same account at the same time from different browsers or with a normal session and an incognito one. I have a requirement where when someone logins in a second browser, the first browser should log out the user in the first browser. Is this achievable in Outsystems? If so how? Also, if this is not possible, what is the best approach in order to just notify that the user is already login in another browser and restrict the second login?

Thank you!

Hi Mihaela Vasiu,

 1).First You have add attribute(Single user) to your entity(Boolean) default value=False.

2).Login Action Check Condition- Check Particular User Login

SyntaxEditor Code Snippet

GetExtrasByUserId.List.Current.Extra.SingleUser=False

Follow the last Image.

3).Under Do login Assign Statement - Enable Login

SyntaxEditor Code Snippet

GetExtrasByUserId.List.Current.Extra.SingleUser=true

Create or Update that Particular Entity.

4).Client logout

Assign under DOLOGOUT action 

SyntaxEditor Code Snippet

User.SingleUser=False

 follow the above picture.


Thank you very much for your reply. It was a very useful and detailed explanation. I noticed that your approach is based on an error message when the user is logging in the second time. Do you have any idea if it is possible in Outsystems to automatically log out the user from the first login instead of showing error messages? Thank you!




Ramesh Kannan.v wrote:

do this below mentioned step Instead(2)

SyntaxEditor Code Snippet
GetExtrasByUserId.List.Current.Extra.SingleUser=False

Mihaela Vasiu wrote:

Hi,

I am working on a project on which it is possible to log in the system with the same account at the same time from different browsers or with a normal session and an incognito one. I have a requirement where when someone logins in a second browser, the first browser should log out the user in the first browser. Is this achievable in Outsystems? If so how? Also, if this is not possible, what is the best approach in order to just notify that the user is already login in another browser and restrict the second login?

Thank you!

Hi Mihaela Vasiu,

 1).First You have add attribute(Single user) to your entity(Boolean) default value=False.

2).Login Action Check Condition- Check Particular User Login

SyntaxEditor Code Snippet

GetExtrasByUserId.List.Current.Extra.SingleUser=False

Follow the last Image.

3).Under Do login Assign Statement - Enable Login

SyntaxEditor Code Snippet

GetExtrasByUserId.List.Current.Extra.SingleUser=true

Create or Update that Particular Entity.

4).Client logout

Assign under DOLOGOUT action 

SyntaxEditor Code Snippet

User.SingleUser=False

 follow the above picture.


Thank you very much for your reply. It was a very useful and detailed explanation. I noticed that your approach is based on an error message when the user is logging in the second time. Do you have any idea if it is possible in Outsystems to automatically log out the user from the first login instead of showing error messages? Thank you!






Ramesh Kannan.v wrote:

Ramesh Kannan.v wrote:

do this below mentioned step Instead(2)

SyntaxEditor Code Snippet
GetExtrasByUserId.List.Current.Extra.SingleUser=False

Mihaela Vasiu wrote:

Hi,

I am working on a project on which it is possible to log in the system with the same account at the same time from different browsers or with a normal session and an incognito one. I have a requirement where when someone logins in a second browser, the first browser should log out the user in the first browser. Is this achievable in Outsystems? If so how? Also, if this is not possible, what is the best approach in order to just notify that the user is already login in another browser and restrict the second login?

Thank you!

Hi Mihaela Vasiu,

 1).First You have add attribute(Single user) to your entity(Boolean) default value=False.

2).Login Action Check Condition- Check Particular User Login

SyntaxEditor Code Snippet

GetExtrasByUserId.List.Current.Extra.SingleUser=False

Follow the last Image.

3).Under Do login Assign Statement - Enable Login

SyntaxEditor Code Snippet

GetExtrasByUserId.List.Current.Extra.SingleUser=true

Create or Update that Particular Entity.

4).Client logout

Assign under DOLOGOUT action 

SyntaxEditor Code Snippet

User.SingleUser=False

 follow the above picture.


Thank you very much for your reply. It was a very useful and detailed explanation. I noticed that your approach is based on an error message when the user is logging in the second time. Do you have any idea if it is possible in Outsystems to automatically log out the user from the first login instead of showing error messages? Thank you!





Ramesh Kannan.v

Thank you very much! But, I tried to implement your proposed solution, but when trying to log in from an incognito window, I am just unable to log in again and the user stills remain logged in in the normal window. What I really want to achieve is this: allow the user to log in from the incognito window and at that moment automatically logout the user from the normal window.



Mihaela Vasiu wrote:

Ramesh Kannan.v wrote:

Ramesh Kannan.v wrote:

do this below mentioned step Instead(2)

SyntaxEditor Code Snippet
GetExtrasByUserId.List.Current.Extra.SingleUser=False

Mihaela Vasiu wrote:

Hi,

I am working on a project on which it is possible to log in the system with the same account at the same time from different browsers or with a normal session and an incognito one. I have a requirement where when someone logins in a second browser, the first browser should log out the user in the first browser. Is this achievable in Outsystems? If so how? Also, if this is not possible, what is the best approach in order to just notify that the user is already login in another browser and restrict the second login?

Thank you!

Hi Mihaela Vasiu,

 1).First You have add attribute(Single user) to your entity(Boolean) default value=False.

2).Login Action Check Condition- Check Particular User Login

SyntaxEditor Code Snippet

GetExtrasByUserId.List.Current.Extra.SingleUser=False

Follow the last Image.

3).Under Do login Assign Statement - Enable Login

SyntaxEditor Code Snippet

GetExtrasByUserId.List.Current.Extra.SingleUser=true

Create or Update that Particular Entity.

4).Client logout

Assign under DOLOGOUT action 

SyntaxEditor Code Snippet

User.SingleUser=False

 follow the above picture.


Thank you very much for your reply. It was a very useful and detailed explanation. I noticed that your approach is based on an error message when the user is logging in the second time. Do you have any idea if it is possible in Outsystems to automatically log out the user from the first login instead of showing error messages? Thank you!





Ramesh Kannan.v

Thank you very much! But, I tried to implement your proposed solution, but when trying to log in from an incognito window, I am just unable to log in again and the user stills remain logged in in the normal window. What I really want to achieve is this: allow the user to log in from the incognito window and at that moment automatically logout the user from the normal window.


I have a requirement where when someone logins in a second browser, the first browser should log out the user in the first browser.

  Based upon your needs please make sure your requirement may be  the first user was the credential user, unfortunately the second user not be you(unauthorized).

  Your needs are possible by session timeout and you be the user for two browser. I will explain.First of all make sure your requirements.



Ramesh Kannan.v 

  Based upon your needs please make sure your requirement may be  the first user was the credential user, unfortunately the second user not be you(unauthorized).

  Your needs are possible by session timeout and you be the user for two browser. I will explain.First of all make sure your requirements.

Yes, this approach is actually what I need (I am the user for two browsers). Many thanks.