Monday, March 28, 2011

Re: Length of session_id()

On Mar 28, 2011, at 19:40, Simon Males wrote:

>>> I'm wondering what the maximum length of session_id() can be.
>>
>> The length would vary depending on what you set for session.hash_function and session.hash_bits_per_character in php.ini.
>
> So hash function 0 (MD5 128bit) and hash_bits_per_characters of 4 equates to:
>
> 128 / 4 = 32.
>
> i.e. session_id key length of 32 characters?
>
> Additionally 128 / 5 = 25.6, which would round up to 26 characters?

That sounds right to me. So the length can vary based on your php.ini settings, but as you say, 255 seems like overkill; I can't think of a combination of the settings that would result in a session id anywhere near that long.


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: