Number of sessions (app)

Number of sessions (app)

by Iván Sibillà García -
Number of replies: 1

Hi,

I would like to know the number of sessions (or logging) that are done through Moodle Mobile (app). Through the table “M_LOGSTORE_STANDARD_LOG” I cannot find enough information to discern if they are made by desktop or by the app.

I have also seen that the tables “M_EXTERNAL_*” are there (EXTERNALSERVICEID = 1). However, I imagine that should be an easier relation than going to query “M_LOGSTORE_STANDARD_LOG” + ACTION = 'loggedin'. Isn't it? (I don't know)

Also, I would like to know the type of device of each session, but I imagine that this information can be obtained by crossing it with the table “M_USER_DEVICES”, is it true?

I would be very grateful if you could help me... thank you very much.

The Moodle version is 3.8.

Average of ratings: -
In reply to Iván Sibillà García

Re: Number of sessions (app)

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The Moodle app users are permanently logged-in (until the authentication token expires, default duration is around 3 months) this is why is not easy to detect user sessions.

My recommendation would be to check the lastmodified field of the external_tokens table, it indicates the last time a user accessed via the mobile app (or web services), you should be storing this data periodically, for example, everyday 30 minutes calculate the last access per user and then consolidate the data.