Skip to Content Skip to Menu

How to realize an Auto LogOut function ?

  • Onkel Tom
  • Onkel Tom
  • OFFLINE
  • Posts: 29
  • Thanks: 4
  • Karma: 1
6 years 11 months ago #299723 by Onkel Tom
How to realize an Auto LogOut function ? was created by Onkel Tom
Hello, I would like to have all users automatically logged out on a certain time of day, or, if this is not possible, after a certain time of inactivity.
I thought, this is done by setting the session time in the Joomla configuration, but I checked this and although the session time is set to 480 Minutes, no user is logged out after this time of inactivity. Even after a whole night the users where in status "logged in" on the next morning, although nothing happend in the system for over 12 hours.

Do you know a solution?

Best regards
Thomas

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 11 months ago #299732 by krileon
Replied by krileon on topic How to realize an Auto LogOut function ?
All they have to do to refresh the session is browse to a new page. If you've any ajax loading behavior that's pinging your site from their browser that'll refresh it too. Typically it's best utilized when they completely close out your site, session time limit is hit, and their session is then deleted (logging them out). There's really no other way of doing it as you risk forcing them to logout when they could still be using your site. Why do you want to force them logged out after a certain time? I mean it's possible to setup a CRON to a Query action to empty the session table, but I really don't recommend doing that.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • Onkel Tom
  • Onkel Tom
  • OFFLINE
  • Posts: 29
  • Thanks: 4
  • Karma: 1
6 years 11 months ago #299748 by Onkel Tom
Replied by Onkel Tom on topic How to realize an Auto LogOut function ?
Hello Kyle,
thanks for your answer. I use the site with CB to realize a common platform for call center agents and the staff of a client. When the clients staff is logged in, the call center agents know these people are present in the company and can talk with customers or can receive email messages to call them back. Therefore it is extremely important that the online status of every staff member is shown correctly. Is someone shown as "online" while indeed he is not, this can lead into confusion and produce trouble. Unfortunately most of the clients staff members do not handle the system with care. They log in when they start to work in the morning, but never log out in the evening when leaving the company. They just shut down the computer without logging themselves out of the system before.
As I described the system does not do an automatic log out after the predefined session time has passed and so sometimes staff members seem to be online next day, but indeed they are not there. This is why I would like to kick them all out of the system late in the evening, so next day every online status is correctly displayed for the call center agents. The automatic log out would never be a problem because nobody will be active in the system after 23 pm, for example.

So if this is possible with a cron job please give the instructions for setting this up.

Thanks a lot.

Thomas

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 11 months ago #299780 by krileon
Replied by krileon on topic How to realize an Auto LogOut function ?
Using session for that won't be reliable. Suggest using a flag system where they need to manually flag themselves present. They'd then need to manually unflag themselves. You can then combine this with online status for more accuracy. So for example if online + flagged = available; offline + flagged = unavailable, offline = unavailable, unflagged = unavailable. The flag could just be a checkbox field.

As for the CRON create an auto action in CB Auto Actions and be sure to leave Triggers as None. After saving your auto action under the Global tab is a URL to execute the auto action directly. You'd use that in a wget CRON call. As for what action you use it's kinda up to you to either use Code and clear sessions with PHP or use Query and just empty the sessions database table. Still do not recommend this approach.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum