Skip to content

Conversation

alexandre-daubois
Copy link
Member

I propose a little cleanup of this file. It contains very long functions, many duplicates and cryptic names. I think that some util functions, early returns and renaming a few vars help clarify intents and readability.

@alexandre-daubois alexandre-daubois marked this pull request as ready for review August 29, 2025 13:28
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! I think most of these clarifications make sense :)

@@ -102,6 +102,7 @@ zend_class_entry *php_session_update_timestamp_iface_entry;

static zend_result php_session_send_cookie(void);
static zend_result php_session_abort(void);
static void ppid2sid(zval *proposed_session_id);
Copy link
Member

Choose a reason for hiding this comment

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

What does PPID stand for?

Comment on lines +1708 to +1709
try_find_session_id_in_global("_GET");
try_find_session_id_in_global("_POST");
Copy link
Member

Choose a reason for hiding this comment

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

Passing the length into the function by using ZEND_STRL() like before makes the most sense IMO


if (name && SG(headers_sent)) {
php_session_headers_already_sent_error(E_WARNING, "Session name cannot be changed after headers have already been sent");
if (name && !can_change_session_setting("name", false)) {
Copy link
Member

Choose a reason for hiding this comment

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

Probably should have a php_ prefix

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.

2 participants