Commit cf415bb0 authored by Dmitrii Metelkin's avatar Dmitrii Metelkin Committed by Robert Lyon
Browse files

Bug#1592236: initialise a session after wwwroot is set

behatnotneeded

Change-Id: Ia73346aa5a71952ee01d4955b864c7f2573d4a03
(cherry picked from commit 23318637f6fbd7c8fa0ba29d79e7acd88488f933)
parent 8825bed5
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -190,11 +190,6 @@ catch (SQLException $e) {
    db_ignore_sql_exceptions(false);
}

// Start up a session object, in case we need to use it to print messages
require_once('auth/session.php');
$SESSION = Session::singleton();


// Make sure wwwroot is set and available, either in the database or in the
// config file. Cron requires it when sending out forums emails.
if (!isset($CFG->wwwroot) && isset($_SERVER['HTTP_HOST'])) {
@@ -249,6 +244,10 @@ if (isset($CFG->wwwroot)) {
    }
}

// Start up a session object, in case we need to use it to print messages
require_once('auth/session.php');
$SESSION = Session::singleton();

// If we have cleanurl subdomains turned on, we need to set cookiedomain
// to ensure cookies are given back to us in all subdomains
if (isset($CFG->cleanurls) && isset($CFG->cleanurlusersubdomains) && !isset($CFG->cookiedomain)) {