Skip to content

Commit

Permalink
Finally the *correct* fix for the looping problem. Thanks to Penny (M…
Browse files Browse the repository at this point in the history
…erged from MOODLE_15_STABLE)
  • Loading branch information
patrickslee committed Sep 7, 2005
1 parent 9d866ae commit dd875f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 1 addition & 4 deletions lib/moodlelib.php
Expand Up @@ -6528,7 +6528,7 @@ function remove_dir($dir, $content_only=false) {
} }


function report_session_error() { function report_session_error() {
global $CFG, $FULLME, $SESSOIN; global $CFG, $FULLME;
if (empty($CFG->lang)) { if (empty($CFG->lang)) {
$CFG->lang = "en"; $CFG->lang = "en";
} }
Expand All @@ -6542,9 +6542,6 @@ function report_session_error() {
} else { } else {
set_config('session_error_counter', 1); set_config('session_error_counter', 1);
} }
unset($_SESSION['USER']);
unset($GLOBALS['USER']);
unset($SESSION->session_test);
redirect($FULLME, get_string('sessionerroruser', 'error'), 2); redirect($FULLME, get_string('sessionerroruser', 'error'), 2);
} }


Expand Down
5 changes: 5 additions & 0 deletions lib/setup.php
Expand Up @@ -314,6 +314,11 @@ class object {};
} else { } else {
$_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] = 'error!!'; $_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] = 'error!!';
} }
} else {
if (empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie])) {
setcookie('MoodleSessionTest'.$CFG->sessioncookie, $_SESSION['SESSION']->session_test, 0, '/');
$_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] = $_SESSION['SESSION']->session_test;
}
} }
if (! isset($_SESSION['USER'])) { if (! isset($_SESSION['USER'])) {
$_SESSION['USER'] = new object; $_SESSION['USER'] = new object;
Expand Down

0 comments on commit dd875f1

Please sign in to comment.