Do some isset() checkings with $CFG->sessioncookie.

Previously when debug turned on, login was impossible
due to some notices sent before writing http headers.
This commit is contained in:
stronk7
2003-10-17 09:54:41 +00:00
parent c1e97fe591
commit 23f6216b92
2 changed files with 15 additions and 4 deletions
+10 -3
View 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 "";
+5 -1
View File
@@ -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;