Skip to content

Commit

Permalink
MDL-21641 cookieless sessions - Need to try to set a cookie before fa…
Browse files Browse the repository at this point in the history
…lling 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.
  • Loading branch information
jamiepratt committed Feb 17, 2010
1 parent 62236dd commit cdf50f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/setup.php
Expand Up @@ -566,10 +566,7 @@ function addslashes_deep($value) {
if (!empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie]) && $_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] == "deleted") { if (!empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie]) && $_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] == "deleted") {
unset($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie]); 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)) { if (empty($nomoodlecookie)) {
session_name('MoodleSession'.$CFG->sessioncookie); session_name('MoodleSession'.$CFG->sessioncookie);
Expand Down Expand Up @@ -618,7 +615,10 @@ function addslashes_deep($value) {
$FULLME = qualified_me(); $FULLME = qualified_me();
$ME = strip_querystring($FULLME); $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 /// 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: /// as a CGI under IIS on Windows) may require that you uncomment the following:
// session_register("USER"); // session_register("USER");
Expand Down

0 comments on commit cdf50f8

Please sign in to comment.