I was struggling with this same issue on a fresh install of OCS 2.3.6 on a Mac Mini Server running Mavericks and Server 3.0.4 (Apache/2.2.26 (Unix) PHP/5.4.24 mod_ssl/2.2.26 OpenSSL/0.9.8y DAV/2, and mySQL 5.5.17).
I kept getting duplicate entries in the sessions table. Each looked like this:
I would delete the row from the sessions table, login again. Same exact key above. Which told me that the field width for sessions.session_id was too small (at 40 chars). Once I extended it out to 128 characters, my session IDs stored in the table are no longer truncated and appear like this:
My session.hash_function in php.ini is default to sha512, by the way.
I hope this information is helpful to those running into "Duplicate entry" issues in the sessions table!