Hi Bubbler’s,
looking for a recommendation on the best way to log out a user after inactive for 1 hour?
Thanks
Hi Bubbler’s,
looking for a recommendation on the best way to log out a user after inactive for 1 hour?
Thanks
For this purpose, you have to log any action made by the user and any navigation event triggered by your user.
I would suggest to add 2 fields in the User data, something like “is connected” and “last event date”.
And each time your user perform a modification / action(ick on a button, and so on) in your app, update this last event date field with the current date time value. Same thing for navigation, each time a page is loaded, update the field with the current date time.
The is connected field would be set to “yes” when the user logs in.
Then add a backend workflow : for any user with “is connected” set to yes, force a log out if the difference between the current date time and the “last event date” field is greater than 1 hour.
But take care, don’t log out a user who could be still active but reading a loooong post!
I think you could set a workflow do every 60 seconds to set the last activity timer by date and also once when the page loads.
If the user has not been there on the app for longer then an hour, you may trigger a recurring scheduled workflow and log the user out.
Thanks, that is great
Yes, I have never tried it but setting the activity change on page load ensures you capture it before the user leaves within the 60 seconds, doing the activity change once every 60 seconds will only happen if the user is on the page, as it’s a workflow action triggered by the client-side.
Alternatively, you can use this plugin to detect online presence: Efactive! New FREE Plugin - Detect if user is online
Basically, it detects the users online presence. If the user is inactive, it returns the user’s inactive time in seconds. With that, you can set a condition that logs the user out when the plugins value is greater than 3600>
Hi @Christophe_HK and @nocodeventure,
How do you think these solutions have an affect on performance?
Regards
No clue. I just try to avoid doing searches as much as possible.
I am not sure. As it’s a backend workflow, it should not be too much impacting for the front end navigation. But if you’re app is using lot of work flows / backend Workflow, it could have an impact yes. It also depends on the number of users you have.
You have mitigation options. You can schedule your backend workflow every 10 minutes, or even every hour. It depends if you except log your users out after exactly one hour, or if 1 hour and a half is not so critical. I would suggest that you give a try and adjust, if need be. But unfortunately, you have not a log of choices to do what you want to do…
This topic was automatically closed after 70 days. New replies are no longer allowed.