Skip Menu |
 

This queue is for tickets about the Apache-Session CPAN distribution.

Report information
The Basics
Id: 7550
Status: resolved
Priority: 0/
Queue: Apache-Session

People
Owner: CHORNY [...] cpan.org
Requestors: chris.jacobson [...] online-rewards.com
Cc: TURNERA [...] cpan.org
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.6
Fixed in: 1.91



Subject: Apache::Session::MySQL Storable "utf8" error
Download (untitled) / with headers
text/plain 1007b
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
Download (untitled) / with headers
text/plain 101b
I've tested with uuencoding and it works fine. But a doc patch would be better. I've attached one.
Download as.patch
text/x-diff 732b
diff -ru Apache-Session-1.80/Session/Store/MySQL.pm Apache-Session-1.80-patched/Session/Store/MySQL.pm --- Apache-Session-1.80/Session/Store/MySQL.pm 2004-02-24 11:05:41.000000000 -0800 +++ Apache-Session-1.80-patched/Session/Store/MySQL.pm 2006-01-30 18:33:57.224243712 -0800 @@ -95,13 +95,13 @@ argument: id char(32) # or however long your session IDs are. - a_session text + a_session blob To create this schema, you can execute this command using the mysql program: CREATE TABLE sessions ( id char(32) not null primary key, - a_session text + a_session blob ); If you use some other command, ensure that there is a unique index on the Only in Apache-Session-1.80-patched/Session/Store: MySQL.pm~


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.