LogOut user in seperate browser (reactive)
Question
Application Type
Reactive
Service Studio Version
11.14.8 (Build 58515)
Platform Version
11.11.3 (Build 29602)

As a requirement from our business, we need to build the functionality to loutout users in different browsers, for example: a user needs to be able to logout of browser 1 when they click a button in browser 2, (or alternatively, if this is not possible, when they login to the same account in browser 2). 

I have tried various methods to achieve this functionality, but have not been able to find a working solution, and most information i can find on the forum uses sessions, which are not available in reactive web.

Does anyone have an example on how to build the requested functionality and terminate concurrent "sessions"? 

Solution

Hi Jan,

follow these steps to achieve it:

  • Create an extension table to your Users table to save the last browser accessed 
  • Get the browser using this action
  • Use in every screen (or action if not too exhaustive) a block with a verification if the browser used is the same as the database, if not, logout.
    • performance will suffer with constant calls to the server
  • On login, save in the database the browser used to login

Regards

Thank you José, trying to replicate your solution, but i noticed that it doesn't recognize the difference between Edge and chrome (both are listed as chrome), so i'll try to tweak a few things to try and make it spot the difference. Will post further updates tomorrow when i book some more progress resolving the issue. 




Thank you, i ended up choosing to use the UserAgent directly to check for the difference, to prevent having to sign up for the whats my browser api, and as the useragent directly does provide the difference between chrome and edge and allows me to log out from the other browser when i login to a new one.



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