[php-src] PR #21181: ext/session: only return false when could not encode session at all
| From: | Girgias | Date: | Mon, 09 Feb 2026 17:59:41 +0000 |
| Subject: | [php-src] PR #21181: ext/session: only return false when could not encode session at all | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-34876@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21181
Author: Girgias
This also fixes bug 71162.
I'm targeting master with this change as it is long-standing behaviour, but I don't really
understand why an "empty session" would fail to encode. Similarly, with a
"partial" encoding of it when discarding numeric keys.
The biggest impact is that
session_encode() now only returns false in very
limited cases and for empty sessions returns an empty string, which is how it was encoded anyway
when actually performing session writes.