Skip to content

ext/session: Fix GH-25705: session_reset() destroys $_SESSION while PS(http_session_vars) still points to it - #25805

Open
Roman3349 wants to merge 1 commit into
php:PHP-8.4from
Roman3349:fix/gh-25705-session-vars-release-order
Open

Roman3349 wants to merge 1 commit into
php:PHP-8.4from
Roman3349:fix/gh-25705-session-vars-release-order

Conversation

@Roman3349

Copy link
Copy Markdown
Contributor

php_session_track_init() released the old session array before installing the new one, so destructors of its values ran against the array being destroyed. Install the new array first and release the old one afterwards. Do the same in php_rshutdown_session_globals(), the php_serialize decoder and session_unset(), and fail the initialization when a destructor closed the session.

Fixes GH-25705

…sing the old one

Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
@Roman3349
Roman3349 force-pushed the fix/gh-25705-session-vars-release-order branch from fe2e45c to 1af41ab Compare November 26, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant