Afonso Carvalho wrote:
Hi Mihaela,
You'll have to manage the User sessions yourself since I don't think Outsystems exposes them: you'd need an Entity with something like:
- a UserId, to identify who owns that session;
- a LastDateOfInteraction, to know when was the last time the session was used;
- something to identify the origin of the session: an IP address, possibly;
And with those three things, you'd be able to identify if a user starts any "concurrent" sessions. The part of your implementation that will vary is going to depend on how quickly you need to react to that second login: if you want the user to be immediately logged out, you'd need to implement something with a server push (like Matthias' suggestion). If it's okay to only log out the user when he goes back and attempts to interact with the application on his first session, then you could have an action that checks for concurrent sessions and logout the user there.
Hi Afonso, thank you very much for your help.
I will try to investigate more about the way I can implement a server push as Matthias suggested.
Regarding the concurrent session, is not clear for me how I can get information about another session. Maybe this is the reason for using an IP address, but how is this achievable in Outsystems? Also, this IP address must be stored in the Entity that you mention?