Subject: | Apache::Session::MySQL Storable "utf8" error |
Distribution Name: Apache::Session
Version: 1.6
Perl Version: This is perl, v5.8.5 built for i86pc-solaris
Operating System: SunOS 5.9 Generic_112234-07 i86pc i386 i86pc (Solaris 9 x86)
MySQL: Ver 14.6 Distrib 4.1.4-gamma, for pc-solaris2.9 (i386)
When using Apache::Session with MySQL as the data store, if you are using 'utf8' as your character set session data will not be stored correctly. Key names are stored correctly, but any data stored in the session hash keys (field a_session) will be returned as zeroes. I believe this is because the way Storable::nfreeze() serializes the data is not compatible with a TEXT utf8 encoded field.
The fix for this is to set the field type for a_session in the database to BLOB instead of TEXT. It is also possible that using Base64 encoding on the session data would avoid this problem as well, however I have not tested this. This utf8 case should probably be reflected somewhere in the Apache::Session::Store::MySQL documentation.
Thanks!
Chris