helper function to get logged in users whose sessions have not expired - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Addins (https://forum.codeigniter.com/forumdisplay.php?fid=34) +--- Thread: helper function to get logged in users whose sessions have not expired (/showthread.php?tid=80228) |
helper function to get logged in users whose sessions have not expired - dgvirtual - 10-02-2021 In managing and using one project I find I need to know if no user is active in the live website, as they might be entering data that I might interrupt. Then I know I can turn on the maintenance mode and do updates to the website. So I have written this helper function that is perhaps IonAuth- specific, but that helps me to find out that data. You can put it into a file in the helper directory (app/Helpers), load it into your project as a helper, and get the list of active users this way: PHP Code: $active_users = active_sessions(); PHP Code: function active_sessions() |