Skip Menu |

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

Report information
The Basics
Id: 3041
Status: resolved
Priority: 0/
Queue: CGI-Session

Owner: Nobody in particular
Requestors: MARKSTOS [...]

Bug Information
Severity: Normal
Broken in: 3.94
Fixed in: (no value)

Subject: [PATCH] deleted sessions should be marked as synch'ed
Download (untitled) / with headers
text/plain 1.3k
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/ Fri May 2 15:10:48 2003 +++ 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 is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to