Skip to content
Permalink
Browse files
Cookie security /Cookie 安全
  • Loading branch information
star7th committed Nov 22, 2021
1 parent a9886f2 commit 654e871a3923e79076818a9a03533fe88222c871
Showing with 12 additions and 0 deletions.
  1. +12 −0 server/index.php
@@ -8,6 +8,18 @@
require './vendor/autoload.php';
}

// cookie安全,给PHPSESSID加上Strict
if (PHP_VERSION_ID >= 70300) {
session_set_cookie_params([
'samesite' => 'Strict'
]);
} else {
session_set_cookie_params(
NULL,
'/; samesite=Strict',
);
}

// 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false
define('APP_DEBUG',True);

0 comments on commit 654e871

Please sign in to comment.