From 7daa0bad40469006660f6880d3b6fa6f2bb58f42 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 23 Jun 2025 15:17:29 +0800 Subject: [PATCH] * [perf story #75382] init session file. --- framework/base/router.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 2322e50702..3b0c43af6e 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -3893,9 +3893,8 @@ class ztSessionHandler implements SessionHandlerInterface $sessFile = $this->getSessionFile($id); if(!$sessFile) return true; - if(!file_exists($sessFile)) touch($sessFile); - - if(!file_exists($sessFile) || !is_writable($sessFile)) return true; + if(!is_file($sessFile) && !touch($sessFile)) return true; + if(!is_writable($sessFile)) return true; if(md5_file($sessFile) == md5($sessData)) return true; if(file_put_contents($sessFile, $sessData, LOCK_EX)) return true; return true;