From 8a8ac14ab925df683ecd481c986662acf885c96c Mon Sep 17 00:00:00 2001 From: Anatoly Pashin Date: Wed, 6 Sep 2017 18:31:45 +1000 Subject: [PATCH] SP-127: fix for php 7.2 --- framework/web/CHttpSession.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/web/CHttpSession.php b/framework/web/CHttpSession.php index 6f949de959..a5f7010cb5 100644 --- a/framework/web/CHttpSession.php +++ b/framework/web/CHttpSession.php @@ -111,7 +111,9 @@ public function open() if($this->getUseCustomStorage()) @session_set_save_handler(array($this,'openSession'),array($this,'closeSession'),array($this,'readSession'),array($this,'writeSession'),array($this,'destroySession'),array($this,'gcSession')); - @session_start(); + if (session_status() !== PHP_SESSION_ACTIVE) { + @session_start(); + } if(YII_DEBUG && session_id()=='') { $message=Yii::t('yii','Failed to start session.');