Skip to content
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

session sid_regexp in error length #4874

Closed
RicherYang opened this issue Oct 25, 2016 · 5 comments
Closed

session sid_regexp in error length #4874

RicherYang opened this issue Oct 25, 2016 · 5 comments

Comments

@RicherYang
Copy link

CI 3.1.1 set the session ID must at less length 40 letter.( _sid_regexp )

But when hash_function = 1 (SHA1) the session_id() is 160-bit digest.
when hash_bits_per_character = 4 it goto 40 char
when hash_bits_per_character = 5 it goto 32 char
when hash_bits_per_character = 6 it goto 27 char

narfbg added a commit that referenced this issue Oct 27, 2016
@narfbg narfbg added this to the 3.1.2 milestone Oct 27, 2016
@narfbg
Copy link
Contributor

narfbg commented Oct 27, 2016

Please test to see if 2f76087 really fixes this.

@RicherYang
Copy link
Author

that can't fix the _sid_regexp error.
BUT I get a new error " Notice: Undefined variable: bits "

My system is php 7.0.11 ( PHP_VERSION_ID 70011 )
in php.ini set session.hash_function = 1 and session.hash_bits_per_character = 5

in the fix use $sid_length = $bits * $bits_per_character; to calculate the sid length.
may change to $sid_length = (int) ceil($bits / $bits_per_character);

narfbg added a commit that referenced this issue Oct 27, 2016
@narfbg
Copy link
Contributor

narfbg commented Oct 27, 2016

How about now?

@RicherYang
Copy link
Author

It work nice on my system.

@narfbg
Copy link
Contributor

narfbg commented Oct 28, 2016

Great, thanks.

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

No branches or pull requests

2 participants