new handling of session timeouts - part 1; merged from MOODLE_15_STABLE

This commit is contained in:
skodak
2005-09-09 15:14:48 +00:00
parent a6feb392fd
commit 4dfa092564
+4 -5
View File
@@ -308,12 +308,11 @@ $CFG->httpswwwroot = $CFG->wwwroot;
if (! isset($_SESSION['SESSION'])) {
$_SESSION['SESSION'] = new object;
$_SESSION['SESSION']->session_test = random_string(10);
if (empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie])) {
setcookie('MoodleSessionTest'.$CFG->sessioncookie, $_SESSION['SESSION']->session_test, 0, '/');
$_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] = $_SESSION['SESSION']->session_test;
} else {
$_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] = 'error!!';
if (!empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie])) {
define('SESSION_HAS_TIMED_OUT', 'true');
}
setcookie('MoodleSessionTest'.$CFG->sessioncookie, $_SESSION['SESSION']->session_test, 0, '/');
$_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] = $_SESSION['SESSION']->session_test;
}
if (! isset($_SESSION['USER'])) {
$_SESSION['USER'] = new object;