Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpFoundation] Fix MockArraySessionStorage to generate more conform ids #57585

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

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Jun 28, 2024

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

Per https://wiki.php.net/rfc/deprecations_php_8_4#sessionsid_length_and_sessionsid_bits_per_character the session id really shouldn't need more than 128bits of entropy, which this PR uses. While this code indeed does not need cryptographically secure level of entropy, it also doesn't really cost that much so I did it this way, as it's IMO good to avoid having cryptographically-insecure code out there where people might take inspiration from it.

As an aside, uniqid might also end up being deprecated, so it's good to get rid of it anyway here https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_uniqid

And as another aside, I've had to override this code in the past because we had DB tables storing session ids not accepting the 64chars long session ids the old code produces, so producing shorter (32chars) ids is more compatible 👍🏻

@carsonbot carsonbot added this to the 5.4 milestone Jun 28, 2024
@carsonbot carsonbot changed the title Fix MockArraySessionStorage to generate more conform ids [HttpFoundation] Fix MockArraySessionStorage to generate more conform ids Jun 28, 2024
@nicolas-grekas
Copy link
Member

Related to #57588

@nicolas-grekas
Copy link
Member

Thank you @Seldaek.

@nicolas-grekas nicolas-grekas merged commit 19b4bf0 into symfony:5.4 Jun 29, 2024
12 checks passed
@Seldaek Seldaek deleted the patch-33 branch July 1, 2024 09:13
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.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.