Skip to content

Fix GH-18634: Show warning when saving session if a pipe character is used in one of the $_SESSION keys #18653

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

Open
wants to merge 3 commits into
base: PHP-8.3
Choose a base branch
from

Conversation

mintopia
Copy link

Added a warning that is raised on session write if one of the session key variables contains the pipe character - as this will cause the session data to not be saved. Tests are included to cover this in both request shutdown and explicitly session_write_close().

mintopia added 2 commits May 24, 2025 12:21
…able key

Changes based on feedback. Updated error message, added explicit test for session_write_close() and tidied up tests.
Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

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

I agree that this should not fail silently, but adding a warning in a bugfix version is probably not okay (because folks turn them into Exceptions).

@mintopia
Copy link
Author

I agree that this should not fail silently, but adding a warning in a bugfix version is probably not okay (because folks turn them into Exceptions).

I can apply this change to master and submit a PR for that if that's OK?

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.

3 participants