A way to force a logout?

A way to force a logout?

by Susanne Bullo -
Number of replies: 3
I am doing a bit of work for a client who uses Moodle and, in the course of creating a function for them, I've noticed that there is nothing to force a logout of a user before leaving the site.  Is there something already out there that does this or does it need to be created?

Thanks!
Average of ratings: -
In reply to Susanne Bullo

Re: A way to force a logout?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
You could set the session timeout very low, but apart from annoying your  users who would get constantly logged out, why would you want to do this?  What does "leaving a site" really mean?
In reply to Martin Dougiamas

Re: A way to force a logout?

by Susanne Bullo -
The moodle site for my client is set up for employees to take courses.  The employer checks a logger I have set up to see when and where the employee was in the course at my client's site.  In order for my little logger to work effectively (it figures out time spent based on login and logout), a proper logout should be executed each time the employee has decided they are done (instead of just leaving the site).
In reply to Susanne Bullo

Re: A way to force a logout?

by Martín Langhoff -
This is generally very hard (impossible?) to do _reliably_ with web apps. Some Javascript tricks can help you, but to a limited extent. The architecture of the web (namely, the HTTP protocol) doesn't support it -- HTTP is originally stateless, and cookes give you a means to track some state information, but nothing as complete as you'd need for this.