OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



session_id in table sessions must be varchar(40)

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

session_id in table sessions must be varchar(40)

Postby raphael » Tue Jan 12, 2010 10:01 am

In php.ini if the hash function is sha1 :
Code: Select all
; 0: MD5   (128 bits) (php 5.x default)
; 1: SHA-1 (160 bits)
session.hash_function = 1



Instead of MD5 (the default) session_id in table sessions is too short to store
the session value (40 chars with sha1). Thus it is impossible to do anything
after install because it triggers a "duplicate key" error found in the sessions
table.

Suggested fix with utf-8 tables :

Code: Select all
 ALTER TABLE `sessions` CHANGE `session_id` `session_id` VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL 


and everything works fine.

Otherwise one should fall back to the php.ini default of MD5 session hash.

I filed a bug with this info : http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=5033

Raphaël
raphael
 
Posts: 4
Joined: Tue Jan 12, 2010 9:37 am

Re: session_id in table sessions must be varchar(40)

Postby asmecher » Tue Jan 12, 2010 11:55 am

Hi Raphaël,

Thanks! Note that you should also update the session_id column in the "captchas" table. It's also best to make sure you update the database descriptors (dbscripts/xml/ojs_schema.xml in pre-2.3 applications, or lib/pkp/xml/schema/common.xml in 2.3 and later); otherwise, when the database is synced against the descriptor during an upgrade, your changes to the live database may be reverted.

See the Bugzilla entry for patches to update the database descriptors.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9230
Joined: Wed Aug 10, 2005 12:56 pm

Re: session_id in table sessions must be varchar(40)

Postby raphael » Tue Jan 12, 2010 5:33 pm

Hi Alec,
thank you very much for the patches, I'm impressed with how fast you fixed it.

regards,
Raphaël
raphael
 
Posts: 4
Joined: Tue Jan 12, 2010 9:37 am


Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest