CodeIgniter Forums
MythAuth: how implement log out from all devices? - 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: MythAuth: how implement log out from all devices? (/showthread.php?tid=80049)



MythAuth: how implement log out from all devices? - manager - 09-07-2021

Hello.
In Myth-auth how to implement log out from all devices except the currently logged-in device?
Thanks in advance.


RE: MythAuth: how implement log out from all devices? - InsiteFX - 09-08-2021

If you set sessionExpiration = 0 then all devices will be logged out on web browser closing.


RE: MythAuth: how implement log out from all devices? - manager - 09-08-2021

(09-08-2021, 02:35 AM)InsiteFX Wrote: If you set sessionExpiration = 0 then all devices will be logged out on web browser closing.

Thank you for your answer.
But i mean how to implement it inside profile page for example.
For example user inside settings page opens security menu and there will be all active sessions with device names and "logout all devices" button. Pressing this button should clear all active sessions in all devices except this one.
Thank you in advance.

[Image: xxcMU4g.png]
://imgur.com/xxcMU4gs://imgur.com/xxcMU4g


RE: MythAuth: how implement log out from all devices? - ikesela - 09-08-2021

try using databasehandler as session handler. more readable data , easy to figure out


RE: MythAuth: how implement log out from all devices? - manager - 09-08-2021

(09-08-2021, 12:44 PM)ikesela Wrote: try using databasehandler as session handler. more readable data , easy to figure out

Thanks for your answer. It would be nice to see some sample (starting point).


RE: MythAuth: how implement log out from all devices? - InsiteFX - 09-09-2021

Assign all devices to an array except for the one you want to keep then loop through it and delete the rest.