From 289783eecdca0d8ac732724ee87ebd1698c72c95 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 25 Nov 2020 15:50:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Conf/config.php | 1 + Application/Home/Conf/config.php | 1 + ThinkPHP/Common/functions.php | 3 +++ 3 files changed, 5 insertions(+) diff --git a/Application/Admin/Conf/config.php b/Application/Admin/Conf/config.php index 4a7bc38bb..e45f7d8cc 100644 --- a/Application/Admin/Conf/config.php +++ b/Application/Admin/Conf/config.php @@ -103,6 +103,7 @@ return array( /* SESSION 和 COOKIE 配置 */ 'SESSION_PREFIX' => 'onethink_admin', //session前缀 + 'SESSION_COOKIE_PATH' => '/admin.php', 'COOKIE_PREFIX' => 'onethink_admin_', // Cookie前缀 避免冲突 'VAR_SESSION_ID' => 'session_id', //修复uploadify插件无法传递session_id的bug diff --git a/Application/Home/Conf/config.php b/Application/Home/Conf/config.php index 36b9fe1af..c172b22c4 100644 --- a/Application/Home/Conf/config.php +++ b/Application/Home/Conf/config.php @@ -70,6 +70,7 @@ return array( /* SESSION 和 COOKIE 配置 */ 'SESSION_PREFIX' => 'onethink_home', //session前缀 + 'SESSION_COOKIE_PATH' => '/index.php', 'COOKIE_PREFIX' => 'onethink_home_', // Cookie前缀 避免冲突 diff --git a/ThinkPHP/Common/functions.php b/ThinkPHP/Common/functions.php index 799da5b63..2b1bc4342 100644 --- a/ThinkPHP/Common/functions.php +++ b/ThinkPHP/Common/functions.php @@ -1243,6 +1243,9 @@ function session($name='',$value='') { if(isset($name['name'])) session_name($name['name']); if(isset($name['path'])) session_save_path($name['path']); if(isset($name['domain'])) ini_set('session.cookie_domain', $name['domain']); + if (C('SESSION_COOKIE_PATH')) { + ini_set('session.cookie_path', C('SESSION_COOKIE_PATH')); + } if(isset($name['expire'])) { ini_set('session.gc_maxlifetime', $name['expire']); ini_set('session.cookie_lifetime', 99999999);