You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SessionInterfaceHandler is throwing a deprecation notice as a warning instead of a deprecation #26001
"Class %s implementing SessionHandlerInterface is missing the create_sid() method which will be required in PHP 9.0",
static void session_handler_interface_gets_implemented(zend_class_entry *self, zend_class_entry *class) {
if (!zend_hash_str_exists(&class->function_table, ZEND_STRL("create_sid"))
&& !session_interfaces_include(class, php_session_id_iface_entry)) {
zend_error(E_WARNING,
"Class %s implementing SessionHandlerInterface is missing the create_sid() method which will be required in PHP 9.0",
ZSTR_VAL(class->name));
}
if (!zend_hash_str_exists(&class->function_table, ZEND_STRL("validateid"))
&& !session_interfaces_include(class, php_session_update_timestamp_iface_entry)) {
zend_error(E_WARNING,
"Class %s implementing SessionHandlerInterface is missing the validateId() method which will be required in PHP 9.0",
ZSTR_VAL(class->name));
}
}
Found this after a PHP 8.5 -> 8.6 upgrade with 3rd party software - tried to filter out deprecation notices but this is coming up as an E_WARNING instead - and it should not be
Simply changing the E_WARNING to a deprecation level should fix the issue - it's annoying!
Thank you for the report. The E_WARNING is intentional. The Deprecations for PHP 8.6 RFC defines two different diagnostics:
passing a handler without create_sid()/validateId() to session_set_save_handler() - E_DEPRECATED, because this usage will stop working in PHP 9.0;
implementing SessionHandlerInterface without these methods - E_WARNING, because the interface will require them in PHP 9.0.
The warning also points at a real security problem. Without validateId(), the user handler accepts every session ID, so session.use_strict_mode (enabled by default since PHP 8.6) does nothing. If an attacker can set the session cookie (e.g. from a subdomain), PHP starts a session with the ID they chose instead of generating a new one. If the application doesn't call session_regenerate_id() after login, the attacker shares the victim's session. That's session fixation, which strict mode is meant to prevent.
To get rid of the warning, add create_sid() and validateId() to the handler class, or implement SessionIdInterface and SessionUpdateTimestampHandlerInterface. You will need these methods in PHP 9.0 anyway. If the handler comes from a third-party package, please report it there.
You are right that UPGRADING calls this "a deprecation". That's wrong, and #26116 fixes it. Changing the level to E_DEPRECATED (#26054) would go against the RFC vote.
Activity
jorgsowa commentedon Dec 6, 2026
Thank you for the report. The
E_WARNINGis intentional. The Deprecations for PHP 8.6 RFC defines two different diagnostics:create_sid()/validateId()tosession_set_save_handler()-E_DEPRECATED, because this usage will stop working in PHP 9.0;SessionHandlerInterfacewithout these methods -E_WARNING, because the interface will require them in PHP 9.0.The warning also points at a real security problem. Without
validateId(), the user handler accepts every session ID, sosession.use_strict_mode(enabled by default since PHP 8.6) does nothing. If an attacker can set the session cookie (e.g. from a subdomain), PHP starts a session with the ID they chose instead of generating a new one. If the application doesn't callsession_regenerate_id()after login, the attacker shares the victim's session. That's session fixation, which strict mode is meant to prevent.To get rid of the warning, add
create_sid()andvalidateId()to the handler class, or implementSessionIdInterfaceandSessionUpdateTimestampHandlerInterface. You will need these methods in PHP 9.0 anyway. If the handler comes from a third-party package, please report it there.You are right that UPGRADING calls this "a deprecation". That's wrong, and #26116 fixes it. Changing the level to
E_DEPRECATED(#26054) would go against the RFC vote.