MDL-21641 cookieless sessions - Need to try to set a cookie before falling back to cookieless mode. Moved test to see if cookies are working till after Moodle has attempted to set a cookie. If there is no cookie then we use session id in url.
This commit is contained in:
+5
-5
@@ -566,10 +566,7 @@ global $HTTPSPAGEREQUIRED;
|
||||
if (!empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie]) && $_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] == "deleted") {
|
||||
unset($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie]);
|
||||
}
|
||||
if (!empty($CFG->usesid) && empty($_COOKIE['MoodleSession'.$CFG->sessioncookie])) {
|
||||
require_once("$CFG->dirroot/lib/cookieless.php");
|
||||
sid_start_ob();
|
||||
}
|
||||
|
||||
|
||||
if (empty($nomoodlecookie)) {
|
||||
session_name('MoodleSession'.$CFG->sessioncookie);
|
||||
@@ -618,7 +615,10 @@ global $HTTPSPAGEREQUIRED;
|
||||
$FULLME = qualified_me();
|
||||
$ME = strip_querystring($FULLME);
|
||||
}
|
||||
|
||||
if (!empty($CFG->usesid) && empty($_COOKIE['MoodleSession'.$CFG->sessioncookie])) {
|
||||
require_once("$CFG->dirroot/lib/cookieless.php");
|
||||
sid_start_ob();
|
||||
}
|
||||
/// In VERY rare cases old PHP server bugs (it has been found on PHP 4.1.2 running
|
||||
/// as a CGI under IIS on Windows) may require that you uncomment the following:
|
||||
// session_register("USER");
|
||||
|
||||
Reference in New Issue
Block a user