Only set session.sid_bits_per_character for PHP < 8.4

PHP 8.4 has deprecated `session.sid_bits_per_character` along with
`session.sid_length`, as part of a broader effort to standardize session ID
generation for improved security and interoperability.
This commit is contained in:
Bastian Lederer 2025-11-28 14:44:44 +01:00 committed by Eric Lippmann
parent f868f4d9d6
commit 5b2747e9cd

View file

@ -68,7 +68,7 @@ class PhpSession extends Session
if (version_compare(PHP_VERSION, '7.1.0') < 0) {
$defaultCookieOptions['hash_function'] = true;
$defaultCookieOptions['hash_bits_per_character'] = 5;
} else {
} elseif (version_compare(PHP_VERSION, '8.4.0') < 0) {
$defaultCookieOptions['sid_bits_per_character'] = 5;
}