]> git.mjollnir.org Git - moodle.git/commitdiff
Do some isset() checkings with $CFG->sessioncookie.
authorstronk7 <stronk7>
Fri, 17 Oct 2003 09:54:41 +0000 (09:54 +0000)
committerstronk7 <stronk7>
Fri, 17 Oct 2003 09:54:41 +0000 (09:54 +0000)
Previously when debug turned on, login was impossible
due to some notices sent before writing http headers.

lib/moodlelib.php
lib/setup.php

index 0eaccf2e2a75e0a87e0cfdc2b7c4e3585750fa46..62281911cde7ceb0d0182c8954f478f811d2e07b 100644 (file)
@@ -500,8 +500,11 @@ function ismoving($courseid) {
 function set_moodle_cookie($thing) {
 /// Sets a moodle cookie with an encrypted string
     global $CFG;
-
-    $cookiename = 'MOODLEID_'.$CFG->sessioncookie;
+    if (isset($CFG->sessioncookie)) {
+        $cookiename = 'MOODLEID_'.$CFG->sessioncookie;
+    } else {
+        $cookiename = 'MOODLEID_';
+    }
 
     $days = 60;
     $seconds = 60*60*24*$days;
@@ -515,7 +518,11 @@ function get_moodle_cookie() {
 /// Gets a moodle cookie with an encrypted string
     global $CFG;
 
-    $cookiename = 'MOODLEID_'.$CFG->sessioncookie;
+    if (isset($CFG->sessioncookie)) {
+        $cookiename = 'MOODLEID_'.$CFG->sessioncookie;
+    } else {
+        $cookiename = 'MOODLEID_';
+    }
 
     if (empty($_COOKIE[$cookiename])) {
         return "";
index 1422136504a134a829d8d74a3bdfac36ad7c31ee..673d5dbe1b838dc3e88c5ec4afbbd828b30d9654 100644 (file)
     class object {};
     
     if (!isset($nomoodlecookie)) {
-        session_name('MoodleSession'.$CFG->sessioncookie);
+        if (isset($CFG->sessioncookie)) {
+            session_name('MoodleSession'.$CFG->sessioncookie);
+        } else {
+            session_name('MoodleSession');
+        }
         @session_start();
         if (! isset($_SESSION['SESSION'])) { 
             $_SESSION['SESSION'] = new object;