From 6c94326bf077d77c5473f3ada6022c578010ca8e Mon Sep 17 00:00:00 2001 From: AJ Dunn Date: Tue, 8 Sep 2026 11:13:13 +0930 Subject: [PATCH] fix: Add create_sid() to CI_SessionWrapper for PHP 8.6 compatibility PHP 8.6 deprecates session save handlers implementing SessionHandlerInterface without a create_sid() method, ahead of making it required in PHP 9.0. Add create_sid(): string to CI_SessionWrapper delegating to session_create_id(). This hook has been supported since PHP 7.1 and maintains identical behavior on PHP 8.0-8.5 while clearing the PHP 8.6 deprecation. Verified across PHP 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, and 8.6 beta 2: - New session start and existing session resumption - session_regenerate_id() and session_regenerate_id(true) - Explicit session_create_id() calls - Zero warnings or deprecations on PHP 8.0-8.5; PHP 8.6 warning cleared --- system/libraries/Session/PHP8SessionWrapper.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/libraries/Session/PHP8SessionWrapper.php b/system/libraries/Session/PHP8SessionWrapper.php index 41889bc6188..d117d139a7f 100644 --- a/system/libraries/Session/PHP8SessionWrapper.php +++ b/system/libraries/Session/PHP8SessionWrapper.php @@ -97,4 +97,9 @@ public function validateId(string $id): bool { return $this->driver->validateId($id); } + + public function create_sid(): string + { + return session_create_id(); + } }