On Mon Sep 18 11:17:09 2006, autarch@urth.org wrote:
Show quoted text> Because I'd rather require a working Apache2::Cookie than have lots of
> hacks based on package and version # in the code.
Since, as you point out, the behavior of Apache2::Cookie->new with an
undefined value for -version is undocumented, whether this is a bug or
you were depending on undefined behavior may still be up for debate. Do
you care to have that our with the libapreq2 folks?
Show quoted text> If I support a workaround for this bug I have to keep doing that, and
it's
Show quoted text> one more thing to worry about.
Since the workaround should be backward compatible, I don't see what you
would have to "keep doing". Why would expiring the cookie before
deleting the session ID from the hash break when run against any other
libapreq version? All it does is ensure that a defined -value is passed
to Apache2::Cookie->new.
Show quoted text> If it _is_ a bug in libapreq2, it should be
> fixed, right?
Yes. Do you think you can convince the libapreq2 maintainers that it is
a bug?
Show quoted text> Meanwhile, it's easy enough to workaround by just using CGI::Cookie.
Actually, I simply created my own version of Apache::Session::Wrapper
with the fix, but it would be nice not to have to port every
Apache::Session::Wrapper change forward into my new (and I was hoping,
temporary) module. Would it help if I volunteered as a comaintainer for
Apache::Session::Wrapper?
Incidentally, you already protect against passing any other undefined
values to Apache2::Cookie->new in _bake_cookie. Protecting the -value
argument in the same way is as effective as my suggested fix, like:
my $cookie =
$self->{cookie_class}->new
( @{ $self->{new_cookie_args} },
-name => $self->{cookie_name},
( defined $self->{session_id}
? ( -value => $self->{session_id} )
: ()
),
( defined $expires
? ( -expires => $expires )
: ()
),
( defined $domain
? ( -domain => $domain )
: ()
),
-path => $self->{cookie_path},
-secure => $self->{cookie_secure},
);
Instead of the current:
my $cookie =
$self->{cookie_class}->new
( @{ $self->{new_cookie_args} },
-name => $self->{cookie_name},
-value => $self->{session_id},
( defined $expires
? ( -expires => $expires )
: ()
),
( defined $domain
? ( -domain => $domain )
: ()
),
-path => $self->{cookie_path},
-secure => $self->{cookie_secure},
);
Thanks again,