From: stronk7 Date: Fri, 17 Oct 2003 09:54:41 +0000 (+0000) Subject: Do some isset() checkings with $CFG->sessioncookie. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=23f6216b928c8b1ce84d8d92fa84c46aefcdab88;p=moodle.git Do some isset() checkings with $CFG->sessioncookie. Previously when debug turned on, login was impossible due to some notices sent before writing http headers. --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 0eaccf2e2a..62281911cd 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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 ""; diff --git a/lib/setup.php b/lib/setup.php index 1422136504..673d5dbe1b 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -171,7 +171,11 @@ 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;