httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <>
Subject Apache2::Cookie and CGI::Cookie
Date Tue, 27 Mar 2007 07:42:47 GMT
I've been looking at the CGI::Cookie:
tests in
run through apreq/glue/perl using Apache2::Cookie:
to create the cookie, and have run across some differences
that lead to failed tests in this context. I'll make
up a proper set of diffs for these tests, but thought it 
better to first raise these issues, to see what sort of 
approach would be best in resolving them.
   In the following, $c is a cookie created with

- if one calls
an error results:
   Usage: APR::Request::Cookie::expires(c, time_str)
which arises from the generated
file: XS_APR__Request__Cookie_expires has in it
        if (items != 2)
 	Perl_croak(aTHX_ "Usage:
           APR::Request::Cookie::expires(c, time_str)");
Thus, it requires an argument. However, apreq_cookie_expires
in apreq/library/cookie.c accepts time_str being NULL, in
which case c->max_age is set to -1. Should $c->expires
work with a null argument?

- The expires() method of CGI::Cookie returns the
expires value, but apreq_cookie_expires is declared as
void, so returns nothing. Would it be useful to have
something that returns the current value? Or perhaps
something that returns the max_age member of the
apreq_cookie_t structure?

- If one sets things like
      my $rv = $c->domain('');
      my $rv = $c->path('/some/new/path/');
then in CGI::Cookie the new value is returned, but
Apache2::Cookie returns the old value. Would there
be a desire to change this, or should the difference
simply be documented?

- If one creates a cookie without specifying the -path,
then in CGI::Cookie a default of '/' is used, but
with Apache2::Cookie $c->path is undef. Should
Apache2::Cookie have '/' as the default path?

best regards,

View raw message