Browse Source

Merge branch 'feature' of artrogue/PhpcmsX into develop

艺术流氓 4 months ago
parent
commit
bbb2d61e1f
1 changed files with 14 additions and 0 deletions
  1. 14 0
      install_package/phpcms/libs/classes/param.class.php

+ 14 - 0
install_package/phpcms/libs/classes/param.class.php

@@ -90,6 +90,12 @@ class param {
 		$_COOKIE[$var] = $value;
 		if (is_array($value)) {
 			foreach($value as $k=>$v) {
+              setcookie($var.'['.$k.']', sys_auth($v, 'ENCODE', md5(PC_PATH.'cookie'.$var).pc_base::load_config('system','auth_key')), $time, pc_base::load_config('system','cookie_path'), pc_base::load_config('system','cookie_domain'), $s, $httponly);
+              /*
+              Chrome浏览器更新影响,关于Cookie 部分新增 SameSite 属性的问题 
+              在HTTPS环境下请使用下面被注释部分的代码,注释上行代码
+              */
+              /*
                 setcookie($var.'['.$k.']', sys_auth($v, 'ENCODE', md5(PC_PATH.'cookie'.$var).pc_base::load_config('system','auth_key')), [
                     'expires' => $time,
                     'path' => pc_base::load_config('system','cookie_path'),
@@ -98,8 +104,15 @@ class param {
                     'httponly' => $httponly,
                     'samesite' => 'None',
                 ]);
+                */
 			}
 		} else {
+          setcookie($var, sys_auth($value, 'ENCODE', md5(PC_PATH.'cookie'.$var).pc_base::load_config('system','auth_key')), $time, pc_base::load_config('system','cookie_path'), pc_base::load_config('system','cookie_domain'), $s, $httponly);
+          /*
+          Chrome浏览器更新影响,关于Cookie 部分新增 SameSite 属性的问题 
+          在HTTPS环境下请使用下面被注释部分的代码,注释上行代码
+         */
+          /*
             setcookie($var, sys_auth($value, 'ENCODE', md5(PC_PATH.'cookie'.$var).pc_base::load_config('system','auth_key')), [
                 'expires' => $time,
                 'path' => pc_base::load_config('system','cookie_path'),
@@ -108,6 +121,7 @@ class param {
                 'httponly' => $httponly,
                 'samesite' => 'None',
             ]);
+            */
 		}
 	}