Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Finally the *correct* fix for the looping problem. Thanks to Penny (M…

…erged from MOODLE_15_STABLE)
  • Loading branch information...
commit dd875f1aa2adbe7734dee33f215b6325fe51a62a 1 parent 9d866ae
authored September 07, 2005
5  lib/moodlelib.php
@@ -6528,7 +6528,7 @@ function remove_dir($dir, $content_only=false) {
6528 6528
 }
6529 6529
 
6530 6530
 function report_session_error() {
6531  
-    global $CFG, $FULLME, $SESSOIN;
  6531
+    global $CFG, $FULLME;
6532 6532
     if (empty($CFG->lang)) {
6533 6533
         $CFG->lang = "en";
6534 6534
     }
@@ -6542,9 +6542,6 @@ function report_session_error() {
6542 6542
     } else {
6543 6543
         set_config('session_error_counter', 1);
6544 6544
     }
6545  
-    unset($_SESSION['USER']);
6546  
-    unset($GLOBALS['USER']);
6547  
-    unset($SESSION->session_test);
6548 6545
     redirect($FULLME, get_string('sessionerroruser', 'error'), 2);
6549 6546
 }
6550 6547
 
5  lib/setup.php
@@ -314,6 +314,11 @@ class object {};
314 314
             } else {
315 315
                 $_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] = 'error!!';
316 316
             }
  317
+        } else {
  318
+            if (empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie])) {
  319
+                setcookie('MoodleSessionTest'.$CFG->sessioncookie, $_SESSION['SESSION']->session_test, 0, '/');
  320
+                $_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] = $_SESSION['SESSION']->session_test;
  321
+            }
317 322
         }
318 323
         if (! isset($_SESSION['USER']))    {
319 324
             $_SESSION['USER']    = new object;

0 notes on commit dd875f1

Please sign in to comment.
Something went wrong with that request. Please try again.