Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-21641 cookieless sessions - Need to try to set a cookie before fa…

…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...
commit cdf50f82de0d53a44e1273d5c1d52669ebe031d4 1 parent 62236dd
James Pratt jamiepratt authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/setup.php
10 lib/setup.php
View
@@ -566,10 +566,7 @@ function addslashes_deep($value) {
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 @@ function addslashes_deep($value) {
$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");
Please sign in to comment.
Something went wrong with that request. Please try again.