Skip to content
Browse files

session management: use YAML::Syck for serialization

When using mysql and a sufficiently recent version
of DBD::mysql that actually respects the mysql_enable_utf8
option, setting the current branch to a name that
includes a diacritic causes the session to fail
and forces the user to the login screen upon
clicking another link.

This turned out to be due to the default (Data::Dumper)
serialization used by CGI::Session, which truncated the
session object at the diacritic.  By enabling
that module's YAML serialization option, the problem
was resolved.

This patch introduces a dependency on the YAML::Syck
module.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
  • Loading branch information...
1 parent 8845110 commit a858e8a8b895640f2be80ea7b0f9a7b97afb4729 Galen Charlton committed with Joshua Ferraro
Showing with 9 additions and 3 deletions.
  1. +3 −3 C4/Auth.pm
  2. +1 −0 Makefile.PL
  3. +1 −0 about.pl
  4. +1 −0 install_misc/debian.packages
  5. +3 −0 installer/install.pl
View
6 C4/Auth.pm
@@ -1083,14 +1083,14 @@ sub get_session {
my $dbh = C4::Context->dbh;
my $session;
if ($storage_method eq 'mysql'){
- $session = new CGI::Session("driver:MySQL", $sessionID, {Handle=>$dbh});
+ $session = new CGI::Session("driver:MySQL;serializer:yaml", $sessionID, {Handle=>$dbh});
}
elsif ($storage_method eq 'Pg') {
- $session = new CGI::Session("driver:PostgreSQL", $sessionID, {Handle=>$dbh});
+ $session = new CGI::Session("driver:PostgreSQL;serializer:yaml", $sessionID, {Handle=>$dbh});
}
else {
# catch all defaults to tmp should work on all systems
- $session = new CGI::Session("driver:File", $sessionID, {Directory=>'/tmp'});
+ $session = new CGI::Session("driver:File;serializer:yaml", $sessionID, {Directory=>'/tmp'});
}
return $session;
}
View
1 Makefile.PL
@@ -520,6 +520,7 @@ WriteMakefile(
'XML::SAX::ParserFactory' => 1.01,
'XML::Simple' => 2.14,
'XML::RSS' => 1.31,
+'YAML::Syck' => 1.00,
},
# File tree mapping
View
1 about.pl
@@ -112,6 +112,7 @@
XML::SAX::ParserFactory
XML::Simple
XML::RSS
+YAML::Syck
/;
my @components = ();
View
1 install_misc/debian.packages
@@ -59,6 +59,7 @@ libxml2-dev install
libxml2-utils install
libxslt1-dev install
libxslt1.1 install
+libyaml-syck-perl install
libyaz install
libyaz-dev install
yaz install
View
3 installer/install.pl
@@ -66,6 +66,9 @@
unless ( eval { require ZOOM } ) {
push @missing, { name => "ZOOM" };
}
+ unless ( eval { require YAML::Syck } ) {
+ push @missing, { name => "YAML::Syck" };
+ }
unless ( eval { require LWP::Simple } ) {
push @missing, { name => "LWP::Simple" };
}

0 comments on commit a858e8a

Please sign in to comment.
Something went wrong with that request. Please try again.