Skip to content

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
@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