Permalink
Browse files

Merge branch 'w49_MDL-37060_m24_sessinit' of git://github.com/skodak/…

…moodle into MOODLE_24_STABLE
  • Loading branch information...
2 parents 35cb0e4 + 8c35475 commit 1c90b9976da578464ef7a199fc6d5e979a4d189e Sam Hemelryk committed Dec 11, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/sessionlib.php
View
@@ -41,13 +41,13 @@ function session_get_instance() {
static $session = null;
- if (!defined('NO_MOODLE_COOKIES')) {
- // Moodle session was not initialised yet in lib/setup.php.
- $session = new emergency_session();
- return $session;
- }
-
if (is_null($session)) {
+ if (!defined('NO_MOODLE_COOKIES') or empty($DB)) {
+ // Moodle was not initialised properly in lib/setup.php.
+ $session = new emergency_session();
+ return $session;
+ }
+
if (empty($CFG->sessiontimeout)) {
$CFG->sessiontimeout = 7200;
}

0 comments on commit 1c90b99

Please sign in to comment.