From 67f48571f416d6eaa9737e336670c08dbb5b2f23 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 5 Nov 2013 14:15:12 -0800 Subject: [PATCH] Fix for session value-loss issue. --- e107_handlers/session_handler.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/e107_handlers/session_handler.php b/e107_handlers/session_handler.php index 61fdce901..af3f165e3 100644 --- a/e107_handlers/session_handler.php +++ b/e107_handlers/session_handler.php @@ -118,6 +118,7 @@ class e_session protected $_namespace; protected $_name; + protected $_sessionStarted = false; // Fixes lost $_SESSION value problem. /** * Validation options @@ -415,7 +416,8 @@ class e_session */ public function start($sessionName = null) { - if (isset($_SESSION)) + + if (isset($_SESSION) && ($this->_sessionStarted == true)) { return $this; } @@ -424,7 +426,7 @@ class e_session { session_save_path($this->_sessionSavePath); } - + switch ($this->_sessionSaveMethod) { case 'db': // TODO session db handling, more methods (e.g. memcache) @@ -471,9 +473,9 @@ class e_session { session_cache_limiter('private'); } - + session_start(); - + $this->_sessionStarted = true; return $this; }