]> git.mjollnir.org Git - moodle.git/commitdiff
Same as Eloy's fix, just a few less lines of code. ;-)
authormoodler <moodler>
Fri, 17 Oct 2003 12:30:17 +0000 (12:30 +0000)
committermoodler <moodler>
Fri, 17 Oct 2003 12:30:17 +0000 (12:30 +0000)
lib/moodlelib.php
lib/setup.php

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