2266
Views
5
Comments
Solved
Overview of all logged in/active end users in the applications
Question

I have a requirement to create an admin page that shows all the logged in end users. So all the users that have an active session.

This question might be related to https://www.outsystems.com/forums/discussion/34240/how-to-check-all-the-logged-in-users-in-the-tool/, but I don't really understand the answer. I can't seem to find a Session entity using Serice Studio. I've looked in the System, Authentication and Users espaces.

I've also searched online, but was not able to find anything useful about this.

Is this possible and if so could you point me in the right direction?

2020-02-28 09-46-54
Eduardo Jauch
Solution

Hello Kilian,

The session database is (usually) a different database. During the platform installation you have to define it separately.

I'm not sure you have direct access to it. In this case, in order to access this database, you need to create an extension and import the entities. To do this, you need the information to create the coneection, including a user to it.

As you can imagine, this is not you should do lightly, for security reasons.

If your installation is in the cloud, doing this will be much more difficulty (if not impossible), as the OutSystems take care of the platform infrastructure.

I'll try to see if there is anything else that can be done, like an alternative solution, or if there is any API that can retrieve the information you need (that I don't know of).

Cheers.

2018-11-08 13-17-54
Kilian Croese
 
MVP

Hi Eduardo, Thank you for your reply. So far I've only worked with cloud installations in the OutSystems Cloud. So I wasn't aware of the session database. The customer were this requirement came from is also using the OutSystems Cloud. I don't think this is a must have requirement. For now I have enough information to provide them with feedback. So don't sent too much time researching this.

If somebody has a (solution) I'm still curious to learn from it.

Thanks! 

2023-12-07 07-51-40
Remco Dekkinga
 
MVP

Hi Kilian,

You can do the following:

  1. Add a Server Event (Right click system actions > Add Server Event) and select the On Begin Web Request.
  2. Every time this event is triggered, store the UserId, SessionId (HttpRequestHandler > GetSessionId()) and CurrDateTime() into a new database entity called UserSession.
  3. When you need to show the Current Logged In users, clean the UserSession entity by the default Session Timeout. You can use the BrowserSession.GetSessionTimeOut() action to get the default Session Timeout from your server.

Hope this helps you to show the active sessions.

Kind regards,

Remco Dekkinga


2019-11-12 17-31-26
Justin James
 
MVP

This code can be easily modified to give you the data you need to make the page you want:

https://www.outsystems.com/forge/component/1886/login-session-timeout-sample/

J.Ja

2018-11-08 13-17-54
Kilian Croese
 
MVP

I'll mark Eduardo's answer as the solution, since I was mainly interested if this was covered with standard platform functionality. Thank you Remco and Justin for pointers how to solve this.

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