Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

CDbHttpSession not working with Session ID > 32 characters #2192

Closed
bluezed opened this Issue Mar 11, 2013 · 1 comment

Comments

2 participants

bluezed commented Mar 11, 2013

I've posted the problem I had in the forum here:
www.yiiframework.com/forum/index.php/topic/41207-cdbhttpsession-queryscalar-always-returns-false/page__gopid__196588

Basically my session IDs are longer than the CHAR(32) specified in CDbHttpSession and hence I had problems using it until I figured it out.

The settings responsible in the php.ini appear to be

session.hash_bits_per_character = 5
session.hash_function = sha256

That means using 'autoCreateSessionTable=true' will not work at all in my case as the CHAR(32) is hardcoded in

protected function createSessionTable($db,$tableName)

Also would be good if in the documentation there was a hint about this as this was all new to me since I haven't paid much attention to session ids up until now.

@samdark samdark closed this in 3d9918e Apr 28, 2013

Owner

samdark commented Apr 28, 2013

Added comments in phpdoc.

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