1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#!/usr/bin/perl -T
# https://rt.cpan.org/Public/Bug/Display.html?id=80346
use strict;
use warnings;
use CGI::Session;
use Scalar::Util qw(tainted);
use Test::More tests => 6;
my $sid;
my $session = CGI::Session->new( "driver:file;serializer:storable", undef, {Directory=>'t'});
ok($session, "new() with file+storable");
$session->param('a', 1 );
$sid = $session->id;
ok(!tainted $sid, "sid not tainted after new");
$session->flush;
$session = CGI::Session->load( "driver:file;serializer:storable", $sid, {Directory=>'t'});
ok($session, "load() with file+storable");
$sid = $session->id;
ok(!tainted $sid, "sid not tainted after load");
is($session->param('a'), 1, "parameter stored");
$session->flush;
ok(1, "survived flush");
$session->delete;
|