From 063698a407eeaa8f10344f456ebcb5d24b0afe65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Thu, 4 Nov 2021 21:12:23 +0800 Subject: [PATCH] * adjust for zt session handler. --- framework/base/router.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 9dca2e5075..57939efd5f 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -2654,6 +2654,8 @@ class ztSessionHandler public $tagID; public $sessionFile; public $sessionID; + public $rawID; + public $rawFile; /** * Construct. @@ -2697,6 +2699,8 @@ class ztSessionHandler $this->sessionFile = $this->sessSavePath . '/' . $fileName; $this->sessionID = $sessionID; + $this->rawID = $id; + $this->rawFile = $this->sessSavePath . '/' . "sess_$id"; return $this->sessionFile; } @@ -2737,7 +2741,11 @@ class ztSessionHandler $sessFile = $this->getSessionFile($id); if(!file_exists($sessFile)) { - ($this->tagID and file_exists("$this->sessSavePath/sess_$id")) ? copy("$this->sessSavePath/sess_$id", $sessFile) : touch($sessFile); + ($this->tagID and file_exists($this->rawFile)) ? copy($this->rawFile, $sessFile) : touch($sessFile); + } + elseif(!file_exists($this->rawFile)) + { + if(strpos(file_get_contents($sessFile), 'user|') !== false) copy($sessFile, $this->rawFile); } return (string) file_get_contents($sessFile); }