This commit is contained in:
Andrie
2026-06-13 15:24:22 +07:00
parent 01df8e6b53
commit 75ca042f40
2 changed files with 26 additions and 1 deletions
@@ -20,7 +20,9 @@ function check($label, $ok) {
check('cookie httponly enabled', strpos($helper, "'httponly' => true") !== false);
check('cookie samesite strict enabled', strpos($helper, "'samesite' => 'Strict'") !== false);
check('cookie secure detects HTTPS', strpos($helper, "'secure' => (!empty(\$_SERVER['HTTPS']) && \$_SERVER['HTTPS'] !== 'off')") !== false);
$has_secure_detect = (strpos($helper, '\'secure\' => $is_https') !== false && strpos($helper, '$is_https =') !== false)
|| strpos($helper, '\'secure\' => (!empty($_SERVER[\'HTTPS\']) && $_SERVER[\'HTTPS\'] !== \'off\')') !== false;
check('cookie secure detects HTTPS', $has_secure_detect);
echo "\n--- {$pass} passed, {$fail} failed ---\n";
exit($fail > 0 ? 1 : 0);