Session time out

Session time out

by Colin Fraser -
Number of replies: 4
Picture of Documentation writers Picture of Testers

Hi all, I have just set up another Moodle for a group and they want to have four course developers, that's all, no users, just these four people. This is a private Moodle where these people can develop materials, try and break it, and so on, but the thing is, they want session timeouts longer than the current four hours currently permitted. [They also wanted things like 1GB uploads for massive video files and such... but I don't have control of the server upload limits, and the time I went and asked for 512mb uploads was truly frightening..sad so that ain't happenin'. ] 

I know, I know, and I am not going to try and talk these guys out of it, but their argument being there are only four people, and who cares how long a session goes for. I have just spent the last three hours looking through the admin folder, settings.php settings and so on, even trying a grep but no luck on finding out which php file the essential code that produces this code that appears in the Server/Settings page:

<div class="form-item clearfix" id="admin-sessiontimeout">
<div class="form-label">
<label for = "id_s__sessiontimeout">Timeout<div class="form-warning">Invalid current value: 43200</div></label>
<span class="form-shortname">sessiontimeout</span>
</div>
<div class="form-setting"><div class="form-select defaultsnext"><select id="id_s__sessiontimeout" name="s__sessiontimeout"><option value="14400">4 hours</option><option value="10800">3 hours</option><option value="7200" selected="selected">2 hours</option><option value="5400">1.5 hours</option><option value="3600">60 minutes</option><option value="2700">45 minutes</option><option value="1800">30 minutes</option><option value="900">15 minutes</option><option value="300">5 minutes</option></select></div><div class="form-defaultinfo">Default: 2 hours</div></div>   [The drop down list code, is located ????.php]
<div class="form-description"><p>If people logged in to this site are idle for a long time (without loading pages) then they are automatically logged out (their session is ended). This variable specifies how long this time should be.</p>
</div>
</div>

I thought it was located in the settings.php but apparently it has been moved, and I did find a reference in Dev Docs to it moving, by Michael de Raadt, but where? According to the Element Inspector Developer Tool in Chrome, it is supposed to be in the settings.php file, but it is either in black text which I can't see in PuTTY, or it's not there. I mistakenly told them that it was an easy fix, but it just ain't so apparently... so mugs on me... 


If anyone can help, it would be greatly appreciated....   sad



 

Average of ratings: -
In reply to Colin Fraser

Re: Session time out

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Just make $CFG->sessiontimeout = some big number (it's in seconds) in your config.php.  I haven't tried it.

I don't think fiddling the code so it never times out is a good idea. 

In reply to Howard Miller

Re: Session time out

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Thanks Howard, and you won't get any argument from me on it, but as long as they hold the pink slip, they mostly get what they want; after all, I am only the janitor, cleaning up other people's messes. Some things are just not doable for me, but I am quite happy to give them 6 hours, but not 12.... I suspect someone is just being lazy, but at 6 hours, they should only need to log in once per day, as long as they bounce a page or two every couple of hours. As someone once said, "not my problem, I just work here." So 6X602  should be enough....  


In reply to Howard Miller

Re: Session time out

by James McLean -

Confirming this works, back in 1.9 days I set this value to 2 months on my local development Moodle so I am essentially never logged out and have been using it ever since. 

Production usage is a different story. Wouldn't recommend anything longer than a couple of hours.

In reply to James McLean

Re: Session time out

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Thanks James, it's not a production Moodle but a development one. They were very specific about that. So maybe.. mmm still thinking. Maybe give them all the Role of Teacher in each category they need, so they can't admin the thing out of existence..smile