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

Sessions fail when generated IDs are greater than 32 characters. #217

Closed
zerocrates opened this issue Jul 31, 2012 · 1 comment
Closed
Labels
Milestone

Comments

@zerocrates
Copy link
Member

See http://omeka.org/forums/topic/admin-login-screen-seems-to-redirect-on-itself

The default PHP session ID is 32 characters long, a hexadecimal representation of a 128-bit MD5 hash. Users can set session.hash_function to '1', which uses SHA-1 instead, and produces 160-bit (40 hex character) hashes. Users can also pick even bigger hashes like sha256 and sha512.

The table we use to store sessions stores the ID (the primary key) as a CHAR(32), so we're truncating any longer ids. This means they won't get looked up correctly, and sessions just won't work. For the SHA-1 setting, users can work around this problem by also setting session.hash_bits_per_character to 5.

We need to do some combination of forcing the hash function PHP uses and altering the sessions table to accommodate bigger session ids.

@jimsafley
Copy link
Member

Is this as easy as altering sessions.id from CHAR(32) to VARCHAR(128)?

zerocrates added a commit that referenced this issue Oct 28, 2013
Since this code will only appear in sites on 2.1+ anyway, we can at the
same time account for users that would otherwise be bitten by #217.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants