automatic logout after x minutes

Hi, is there a way to automatically logout a user after x minutes of inactivity. thanks, HP
4 answers

You would need to add your own workflow to all your forms to track last user activity and update a date/time field which you can then check in a scheduled event.

Bear in mind that if you have anonymous users allowed, logging a user out will not release the license - it will just change them from an named to an anonymous user, still consuming a license.

So, in this situation you cannot release inactive licenses using a scheduled event on the server. You need to do it from the client using a microflow timer widget event, and then you can redirect to a page outside the application as part of the microflow to release the license

And that microflow timer would need to run on every form the user might be 'parked' on

Edit: I just implemented this as a result of this thread and have it working OK.

In my application I use a Launchpad form for anonymous users (defined under Alternative Home Pages of Navigation). I used a Scheduled Event to log-out the inactive users, which returns them to the Launchpad form where they are then an anonymous user. I then have a microflow timer (set to run once) on the Launchpad form only that sends them to a form which uses the URL Redirector to open an external URL in the same browser window. It seems to work OK.

A few other implementation notes:

1) Added a Date/time field to the Account object to record Last Activity, and created a microflow to set this to the current time. Called this microflow where needed to update the last activity time, such as in menus

2) Added actions to update last activity time in before commit actions (on saves) for all data objects. I was able to do this in a super-entity that already existed in my application for record-locking purposes, so was able to achieve this with just one microflow

3) The microflow timer on the Launchpad form needs to be placed in a data view or template grid. I create a record in a temp entity as part of the microflow action to open the launchpad form, so can open it in a dataview.

4) I used the existing java action (from view active sessions) to identify current active sessions. Retrieving this list filtered on the last activity date attribute above gave me a list of active users who have done nothing for xx mins. I then had to create a simple java action to log-out these users

Hope this helps.


Hmmm, from what I can recollect from a long time ago. We had the same question from a client because of the concurrent usage license. The answer Mendix gave then that a user was standard logged out after 30 minutes of inactivity and that this time could be altered in the settings (m2eerc). But in the m2eerc I can not find such a setting indeed. So I am curious to the Mendix answer this time. With a concurrent usage model this is something that we developers should have an influance on.

Create a scheduled task: 
Retrieve sessions,  filter on lastAction . 
Delete all sessions that have been inactive for 10 minutes.

Why would you want to do that?