mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
I think this might solve the mysterious problems with
session garbage collection and timeouts not working. Note: upgrading to this will KILL all current sessions, so you will need to log back in.
This commit is contained in:
parent
811cf8919d
commit
39e1c4158f
2 changed files with 7 additions and 10 deletions
|
@ -18,11 +18,11 @@
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Check some PHP server settings
|
/// Check some PHP server settings
|
||||||
|
|
||||||
$documentationlink = "please read the <A HREF=\"../doc/?frame=install.html&sub=webserver\">install documentation</A>";
|
$documentationlink = "please read the <A HREF=\"../doc/?frame=install.html&sub=webserver\">install documentation</A>";
|
||||||
|
|
||||||
|
|
||||||
if (ini_get_bool('session.auto_start')) {
|
if (ini_get_bool('session.auto_start')) {
|
||||||
error("The PHP server variable 'session.auto_start' should be Off - $documentationlink");
|
error("The PHP server variable 'session.auto_start' should be Off - $documentationlink");
|
||||||
}
|
}
|
||||||
|
@ -36,15 +36,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// Check that sessions are supported
|
|
||||||
|
|
||||||
if (!is_readable(ini_get('session.save_path')) and !ini_get_bool('safe_mode')) {
|
|
||||||
$sessionpath = ini_get('session.save_path');
|
|
||||||
notify("Warning: It appears your server does not support sessions (session.save_path = '$sessionpath')");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// Check that config.php has been edited
|
/// Check that config.php has been edited
|
||||||
|
|
||||||
if ($CFG->wwwroot == "http://example.com/moodle") {
|
if ($CFG->wwwroot == "http://example.com/moodle") {
|
||||||
|
|
|
@ -101,6 +101,12 @@
|
||||||
ini_set('session.gc_maxlifetime', $CFG->sessiontimeout);
|
ini_set('session.gc_maxlifetime', $CFG->sessiontimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set custom session path
|
||||||
|
if (!file_exists("$CFG->dataroot/sessions")) {
|
||||||
|
make_upload_directory('sessions');
|
||||||
|
}
|
||||||
|
ini_set('session.save_path', "$CFG->dataroot/sessions");
|
||||||
|
|
||||||
/// Set sessioncookie variable if it isn't already
|
/// Set sessioncookie variable if it isn't already
|
||||||
if (!isset($CFG->sessioncookie)) {
|
if (!isset($CFG->sessioncookie)) {
|
||||||
$CFG->sessioncookie = '';
|
$CFG->sessioncookie = '';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue