Skip to content

Commit

Permalink
MDL-65812 session: Increase default timeout and allow larger periods
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanheywood committed Jan 11, 2020
1 parent 77d1c41 commit 859ed92
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
13 changes: 4 additions & 9 deletions admin/settings/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,10 @@
if (empty($CFG->session_handler_class) and $DB->session_lock_supported()) {
$temp->add(new admin_setting_configcheckbox('dbsessions', new lang_string('dbsessions', 'admin'), new lang_string('configdbsessions', 'admin'), 0));
}
$temp->add(new admin_setting_configselect('sessiontimeout', new lang_string('sessiontimeout', 'admin'), new lang_string('configsessiontimeout', 'admin'), 7200, array(14400 => new lang_string('numhours', '', 4),
10800 => new lang_string('numhours', '', 3),
7200 => new lang_string('numhours', '', 2),
5400 => new lang_string('numhours', '', '1.5'),
3600 => new lang_string('numminutes', '', 60),
2700 => new lang_string('numminutes', '', 45),
1800 => new lang_string('numminutes', '', 30),
900 => new lang_string('numminutes', '', 15),
300 => new lang_string('numminutes', '', 5))));

$temp->add(new admin_setting_configduration('sessiontimeout', new lang_string('sessiontimeout', 'admin'),
new lang_string('configsessiontimeout', 'admin'), 8 * 60 * 60));

$temp->add(new admin_setting_configtext('sessioncookie', new lang_string('sessioncookie', 'admin'), new lang_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));
$temp->add(new admin_setting_configtext('sessioncookiepath', new lang_string('sessioncookiepath', 'admin'), new lang_string('configsessioncookiepath', 'admin'), '', PARAM_RAW));
$temp->add(new admin_setting_configtext('sessioncookiedomain', new lang_string('sessioncookiedomain', 'admin'), new lang_string('configsessioncookiedomain', 'admin'), '', PARAM_RAW, 50));
Expand Down
4 changes: 2 additions & 2 deletions lib/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ function xmldb_main_install() {
'backup_version' => 2008111700,
'backup_release' => '2.0 dev',
'mnet_dispatcher_mode' => 'off',
'sessiontimeout' => 7200, // must be present during roles installation
'stringfilters' => '', // These two are managed in a strange way by the filters
'sessiontimeout' => 8 * 60 * 60, // Must be present during roles installation.
'stringfilters' => '', // These two are managed in a strange way by the filters.
'filterall' => 0, // setting page, so have to be initialised here.
'texteditors' => 'atto,tinymce,textarea',
'antiviruses' => '',
Expand Down
2 changes: 1 addition & 1 deletion lib/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@

// Start session and prepare global $SESSION, $USER.
if (empty($CFG->sessiontimeout)) {
$CFG->sessiontimeout = 7200;
$CFG->sessiontimeout = 8 * 60 * 60;
}
\core\session\manager::start();

Expand Down
1 change: 1 addition & 0 deletions lib/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ information provided here is intended especially for developers.
which means auto-detecting number of decimal points.
* plagiarism_save_form_elements() has been deprecated. Please use {plugin name}_coursemodule_edit_post_actions() instead.
* plagiarism_get_form_elements_module() has been deprecated. Please use {plugin name}_coursemodule_standard_elements() instead.
* Changed default sessiontimeout to 8 hours to cover most normal working days

=== 3.8 ===
* Add CLI option to notify all cron tasks to stop: admin/cli/cron.php --stop
Expand Down

0 comments on commit 859ed92

Please sign in to comment.