where can I view logged in users in application

0
I have set persistentsessions to true and now want to check which users are logged in.How can I show the information related to logged in users like username, when logged in(date and time).Also is there possibility to show allowed number of concurrent users?
asked
4 answers
1

This is only sort of possible by enabling the custom setting https://world.mendix.com/display/refguide6/Custom%20Settings PersistentSessions which will then be saved in the database and viewable in the application.

Or if you store the logged in user information right after the user logs in and remove it after the user logs off, however, this is not perfect since users also tend to just close their laptop, browse to a different application/website etc.

answered
2

If you are just interested in how many users are logged in right now you could also use a Java action for this which returns an "Integer/Long" and contains the following code:

return Core.getConcurrentUserCount(true); // false if you want to exclude anonymous users from the count.
answered
0

Go to the Environment Details of your node (Deploy section), then there's a button on the right Show Logged in Users.

answered
0

In a custom Java action you can use: Core.getActiveSessions() which gives all active sessions, i.e. logged in users. For each session you can get the username via: session.getUser().getName();

To get information abour your license you might be lucky with: Core.getComponent().licenseUtil().getUserLimitations(); UserLimitation object has getAllowedNumberOfUsers(), but I haven't tested this.

answered