Skip to content

ext/session: Close the save handler when create_sid() fails - #23800

Open
iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/session-regen-id-close-handler-84
Open

iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/session-regen-id-close-handler-84

Conversation

@iliaal

@iliaal iliaal commented Sep 20, 2026

Copy link
Copy Markdown
Member

php_session_regenerate_id() opens the save handler with s_open() and then throws when s_create_sid() returns no id, leaving mod_data open until request shutdown and double-opening it on the next session start. The collision-retry failure path a few lines up in the same function already closes the handler; this does the same on the null-id path.

php_session_regenerate_id() opened the handler with s_open() and then threw
when s_create_sid() returned no id, leaving mod_data open until request
shutdown and double-opening it on the next session start. The
collision-retry failure path in the same function already closes the
handler; do the same on the null-id path.
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