Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: ianburrell [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.88
Fixed in: 1.89



Subject: Apache::Session::Store::File::materialize appends to existing serialized value
Doing multiple restore() on a single session without any save() causes the serialized value to keep growing. It may be possible that newly read values aren't used by the Storable serializer as it seems to be parse the first value. It is also possible Our code does this to reread the session in small critical sections: $self->make_unsynced(); $self->acquire_read_lock(); $self->restore(); // do critical section $self->release_read_lock(); Clearing the $session->{serialized} before reading the file in Apache::Session::File::Store fixes the problem.
From: ianburrell [...] gmail.com
Here is a patch which clears the serialized value before reading.
Subject: file_clear_serialized.patch
# HG changeset patch # User Ian Burrell <imb@rentrak.com> # Date 1271711896 25200 # Node ID 1f4528da4840196facbb8484dac864f039e605cc # Parent 28db5f1cddc3bffae8d986ef6009f45a303ddff5 Clear serialized in materialize before reading new value diff -r 28db5f1cddc3 -r 1f4528da4840 Session/Store/File.pm --- a/Session/Store/File.pm Mon Apr 19 14:14:35 2010 -0700 +++ b/Session/Store/File.pm Mon Apr 19 14:18:16 2010 -0700 @@ -87,6 +87,8 @@ seek($self->{fh}, 0, 0) || die "Could not seek file: $!"; } + $session->{serialized} = ''; + my $fh = $self->{fh}; while (my $line = <$fh>) { $session->{serialized} .= $line;