From ac3967cab72763defe5e6f4a22ed1a6a50cf9ab7 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 11 Dec 2013 16:47:30 +0100 Subject: [PATCH] removed unused property from Session cleanup after #1479 --- framework/yii/web/Session.php | 44 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/framework/yii/web/Session.php b/framework/yii/web/Session.php index e957040..903e9d9 100644 --- a/framework/yii/web/Session.php +++ b/framework/yii/web/Session.php @@ -112,43 +112,36 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co return false; } - private $_opened = false; - /** * Starts the session. */ public function open() { if (session_status() == PHP_SESSION_ACTIVE) { - $this->_opened = true; return; } - if (!$this->_opened) { - if ($this->getUseCustomStorage()) { - @session_set_save_handler( - [$this, 'openSession'], - [$this, 'closeSession'], - [$this, 'readSession'], - [$this, 'writeSession'], - [$this, 'destroySession'], - [$this, 'gcSession'] - ); - } + if ($this->getUseCustomStorage()) { + @session_set_save_handler( + [$this, 'openSession'], + [$this, 'closeSession'], + [$this, 'readSession'], + [$this, 'writeSession'], + [$this, 'destroySession'], + [$this, 'gcSession'] + ); + } - $this->setCookieParamsInternal(); + $this->setCookieParamsInternal(); - @session_start(); + @session_start(); - if (session_id() == '') { - $this->_opened = false; - $error = error_get_last(); - $message = isset($error['message']) ? $error['message'] : 'Failed to start session.'; - Yii::error($message, __METHOD__); - } else { - $this->_opened = true; - $this->updateFlashCounters(); - } + if (session_id() == '') { + $error = error_get_last(); + $message = isset($error['message']) ? $error['message'] : 'Failed to start session.'; + Yii::error($message, __METHOD__); + } else { + $this->updateFlashCounters(); } } @@ -157,7 +150,6 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co */ public function close() { - $this->_opened = false; if (session_id() !== '') { @session_write_close(); }