I had a user who left his session open from Saturday to Monday. when he came back on Monday, he could no longer access his data but he was not logged out either. At least that is my interpretation of what happened. So it looked as he had not created some things that he did create. Then he logged out and logged in again and the things were there.
Questions:
how do we control session duration?
how do we log out users automatically if session expires?
Create a data field under your user data type called ālog-in-timeā. Set this field type to be a date.
Create a workflow that runs every time the page is loaded. Within this workflow, you can update the ālog-in-timeā field to be the current date time.
This log-in time will update each time a page will load, therefore, resetting the userās session. If youād like to avoid this, you could create a condition on the workflow trigger that only allows it to run when the 'log-in timeās date is the current date time +X hrs/mins.
This means that in an average user session, this time should only update once. Of course, if the user leaves the session open and doesnāt refresh the page, this data field wouldnāt update.
Create another workflow thatās triggered from the ādo when condition is trueā action. The condition could recognise when the current date/time is X minutes (however long youād like a session to be) greater than the ālog-in-timeā field on a users profile.
If this condition is true, you could run add an action to then log the user out and send them through to the login page.
I ended up googling and implementing something before I had a chance to read your post.
These are the building blocks of the solution:
i installed a free plug in to detect inactivity (detect inactivity, free plugin)
I installed the plugin ācountdownā (also a free plugin)
set up the inactivity plugin to activate after x minutes
at that point in time, a pop up appears and i start a countdown
if the user does not react during the countdown, they are logged out
I also allowed for changing the inactivity time in the user settings, with a minimum of X.
Worked pretty well, the UX also looks nice. Again, thanks for the tip and apologies that I did not see it in time. Posting the solution here in the event anyone is interested.