Skip to content

Fix GH-16385: Unexpected null returned by session_set_cookie_params #16386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

Two issues:

  1. The check happened before ZPP checks
  2. The return; statement caused NULL to be returned while this
    function can only return booleans. An exception seems not acceptable
    in stable versions, but a warning may do.

Two issues:
1) The check happened before ZPP checks
2) The `return;` statement caused NULL to be returned while this
   function can only return booleans. An exception seems not acceptable
   in stable versions, but a warning may do.
@nielsdos nielsdos requested a review from Girgias as a code owner October 12, 2024 08:25
@nielsdos nielsdos linked an issue Oct 12, 2024 that may be closed by this pull request
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment on lines +1680 to +1683
if (!PS(use_cookies)) {
php_error_docref(NULL, E_WARNING, "Session cookies cannot be used when session.use_cookies is disabled");
RETURN_FALSE;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we even bother with an exception in master? Wasn't that INI setting deprecated in 8.4?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, for BC reasons this INI setting was left unaffected: https://wiki.php.net/rfc/deprecate-get-post-sessions#sessionuse_cookies_off

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the code for settings checks seems to use warnings, so if we change it we should be consistent. Maybe for now let's not

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AAAAAAAAAA okay, then it makes sense, but maybe it should be a more cohesive change to convert ext/session warnings to exceptions.

@nielsdos nielsdos closed this in 7cdd130 Oct 12, 2024
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.

Unexpected null returned by session_set_cookie_params
2 participants