diff --git a/DataStorage/Session/HttpSession.php b/DataStorage/Session/HttpSession.php index d27a40f44..b3b8288ea 100644 --- a/DataStorage/Session/HttpSession.php +++ b/DataStorage/Session/HttpSession.php @@ -62,7 +62,7 @@ class HttpSession implements SessionInterface $_SESSION = null; $this->sid = session_id(); - session_write_close(); + $this->set('UID', 0, false); if(($CSRF = $this->get('CSRF')) === null) { $CSRF = StringUtils::generateString(10, 16); @@ -99,10 +99,7 @@ class HttpSession implements SessionInterface */ public function save() { - session_id($this->sid); - session_start(); - $_SESSION = $this->sessionData; - session_write_close(); + } /** @@ -135,4 +132,10 @@ class HttpSession implements SessionInterface $this->sid = $sid; } + public function __destruct() + { + $_SESSION = $this->sessionData; + session_write_close(); + } + }