httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject Apache2::Cookie and CGI::Cookie
Date Tue, 27 Mar 2007 07:42:47 GMT
I've been looking at the CGI::Cookie:
  http://search.cpan.org/~lds/CGI.pm-3.27/CGI/Cookie.pm
tests in CGI.pm:
   http://search.cpan.org/src/LDS/CGI.pm-3.27/t/cookie.t
run through apreq/glue/perl using Apache2::Cookie:
  http://search.cpan.org/~joesuf/libapreq2-2.08/glue/perl/lib/Apache2/Cookie.pm
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
Apache2::Cookie:

- if one calls
     $c->expires;
an error results:
   Usage: APR::Request::Cookie::expires(c, time_str)
which arises from the generated
   apreq/glue/perl/xs/APR/Request/Cookie/Cookie.c
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('some.new.domain');
   or
      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,
Randy

Mime
View raw message