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

Report information
The Basics
Id:
3041
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
MARKSTOS [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
3.94
Fixed in:
(no value)



Subject: [PATCH] deleted sessions should be marked as synch'ed
Hello, I'm writing a new SQL driver for CGI::Session. During this I uncovered what I think is a bug in how CGI::Session handles it's internal status. Here's the sequence in my test script that exposed it: ok($s2->close, 'closing 2nd session'); ok($dbh->disconnect, 'disconnecting'); Also the session was closed, it's status remained 'deleted', so that after the DB connection was closed, "flush" was run again as part of DESTROY. when it tried to "remove" again because the status was still DELETED, there was a problem because the database handle was no longer there. I think that after a session is deleted/removed, it's status should be 'synched'. Because until the session object changes again, having nothing in the database is the same as having nothing in the session object. :) The below simple patch corrects these. "make test" continues to perform fine with the change. --- /usr/local/lib/perl5/site_perl/5.8.0/CGI/Session.pm Fri May 2 15:10:48 2003 +++ Session.pm Fri Jul 25 12:05:08 2003 @@ -428,10 +428,10 @@ if ( $status == MODIFIED ) { $self->store($self->id, $self->{_OPTIONS}, $self->{_DATA}) or return; - $self->{_STATUS} = SYNCED; } elsif ( $status == DELETED ) { $self->remove($self->id, $self->{_OPTIONS}) or return; } + $self->{_STATUS} = SYNCED; return 1; }
Fixed. Thanks.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

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