Subject: | Serializer does not handle embedded linefeeds |
Following doesn't work when I try to save session data that has embedded linefeeds. My workaround is to normalize the whitespace (fortunately it's HTML data) but I would think I should be able to serialize anything.
#!/usr/bin/perl -w
use strict;
use PHP::Session::Serializer::PHP;
use Data::Dumper;
my $serializer = PHP::Session::Serializer::PHP->new;
my %data = ( lines => "foo\nbar" );
my $enc = $serializer->encode(\%data);
print "Encoded:\n[$enc]\n";
my $hashref = $serializer->decode($enc);
print "Decoded: ", Dumper( $hashref ), "\n";