Return-Path: Delivered-To: apmail-httpd-apreq-dev-archive@www.apache.org Received: (qmail 11875 invoked from network); 27 Mar 2007 06:46:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Mar 2007 06:46:23 -0000 Received: (qmail 5549 invoked by uid 500); 27 Mar 2007 06:46:30 -0000 Delivered-To: apmail-httpd-apreq-dev-archive@httpd.apache.org Received: (qmail 5533 invoked by uid 500); 27 Mar 2007 06:46:30 -0000 Mailing-List: contact apreq-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list apreq-dev@httpd.apache.org Received: (qmail 5518 invoked by uid 99); 27 Mar 2007 06:46:30 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [142.132.30.225] (HELO theoryx5.uwinnipeg.ca) (142.132.30.225) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2007 23:46:28 -0700 Received: from theoryx5.uwinnipeg.ca (localhost.localdomain [127.0.0.1]) by theoryx5.uwinnipeg.ca (8.12.8/8.12.8) with ESMTP id l2R7glpL010821 for ; Tue, 27 Mar 2007 01:42:47 -0600 Received: from localhost (randy@localhost) by theoryx5.uwinnipeg.ca (8.12.8/8.12.8/Submit) with ESMTP id l2R7glgY010817 for ; Tue, 27 Mar 2007 01:42:47 -0600 Date: Tue, 27 Mar 2007 01:42:47 -0600 (CST) From: Randy Kobes To: apreq-dev@httpd.apache.org Subject: Apache2::Cookie and CGI::Cookie Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Checked: Checked by ClamAV on apache.org 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