diff --git a/pandora_console/mobile/include/system.class.php b/pandora_console/mobile/include/system.class.php index d2c45f0e6c..cb365f95f1 100644 --- a/pandora_console/mobile/include/system.class.php +++ b/pandora_console/mobile/include/system.class.php @@ -23,9 +23,7 @@ class System { $this->loadConfig(); $session_id = session_id(); DB::getInstance($this->getConfig('db_engine', 'mysql')); - if (empty($session_id)) { - session_start(); - } + if (session_status() === PHP_SESSION_NONE) session_start(); $this->session = $_SESSION; session_write_close(); @@ -71,7 +69,7 @@ class System { } public function setSessionBase($name, $value) { - session_start(); + if (session_status() === PHP_SESSION_NONE) session_start(); $_SESSION[$name] = $value; session_write_close(); } @@ -79,7 +77,7 @@ class System { public function setSession($name, $value) { $this->session[$name] = $value; - session_start(); + if (session_status() === PHP_SESSION_NONE) session_start(); $_SESSION = $this->session; session_write_close(); } @@ -94,7 +92,7 @@ class System { } public function sessionDestroy() { - session_start(); + if (session_status() === PHP_SESSION_NONE) session_start(); session_destroy(); } diff --git a/pandora_console/mobile/index.php b/pandora_console/mobile/index.php index 0c80cefd6b..8b0a4f28a2 100644 --- a/pandora_console/mobile/index.php +++ b/pandora_console/mobile/index.php @@ -19,13 +19,20 @@ if (function_exists ('mb_internal_encoding')) { } $develop_bypass = 0; -require_once '../include/config.php'; require_once("include/ui.class.php"); require_once("include/system.class.php"); require_once("include/db.class.php"); require_once("include/user.class.php"); +/* Info: + * The classes above doesn't start any session before it's properly + * configured into the file below, but it's important the classes + * exist at the time the session is started for things like + * serializing objects stored into the session. + */ +require_once '../include/config.php'; + require_once('operation/home.php'); require_once('operation/tactical.php'); require_once('operation/groups.php'); @@ -78,7 +85,6 @@ $system = System::getInstance(); require_once($system->getConfig('homedir').'/include/constants.php'); $user = User::getInstance(); - $user->saveLogin(); $default_page = 'home';