Skip to content

Maximum length of prefix in session_create_id #3650

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
Aug 11, 2024
Merged

Conversation

jorgsowa
Copy link
Contributor

@jorgsowa jorgsowa changed the title Update session-create-id.xml Maximum length of prefix in session_create_id Aug 11, 2024
@cmb69
Copy link
Member

cmb69 commented Aug 11, 2024

Maximum length of prefix is 256 characters.

Right. Thanks for the PR!

Unfortunately, the code is not clear that it is about the prefix here (and elsewhere about the length of the actual SID without prefix), but we can't easily change this, because php_session_valid_key() is public.

And the error message can be confusing:

var_dump(session_create_id(str_repeat("a", 257)));
Warning: session_create_id(): Prefix cannot contain special characters. Only aphanumeric, ',', '-' are allowed in …
bool(false)

@cmb69 cmb69 merged commit a846e49 into php:master Aug 11, 2024
2 checks passed
@jorgsowa
Copy link
Contributor Author

Thank you. I created related PR for php-src also: php/php-src#15338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants