Joe
I took your advise and tried to provide a patch for the test-suite
which should test the things related to the expiration and the secure flag.
##########################################################
--- t/cookie.c 2003-12-18 17:48:13.000000000 +0100
+++ t/cookie3.c 2003-12-18 17:43:06.000000000 +0100
@@ -112,6 +112,12 @@
CuAssertStrEquals(tc,apr_pstrcat(p,
"foo=bar; path=/quux; domain=example.com; expires
=",
apreq_expires(p,"+1y",NSCOOKIE), NULL),
apreq_cookie_as_string(p,c));
+ apreq_cookie_expires(c,"Thu, 17-Dec-2009 16:26:47 GMT");
+ CuAssertStrEquals(tc, "foo=bar; path=/quux; domain=example.com;
expires=Thu, 17-Dec-2009 16:26:47 GMT",
+ apreq_cookie_as_string(p,c));
+ c->secure = 1;
+ CuAssertStrEquals(tc, "foo=bar; path=/quux; domain=example.com;
expires=Thu, 17-Dec-2009 16:26:47 GMT; secure",
+ apreq_cookie_as_string(p,c));
}
#############################################
BTW, in trying to set a fixed timestamp as the expiration (as described in
the CGI docs) I still get an error.
So the relative part works but not the fixed, but to catch the previously
reported bug (expiration) you
can't rely on the relative since both sides(apreq_cookie_expires /
apreq_expires) were broken and so reported the same results (always now).
Anyway, I hope the few lines of code will help.
Mit freundlichen Gr��en / Best Regards
Swen Schillig
|---------+---------------------------->
| | Joe Schaefer |
| | <[EMAIL PROTECTED]|
| | rsys.com> |
| | Sent by: news |
| | <[EMAIL PROTECTED]|
| | rg> |
| | |
| | |
| | 12/18/2003 01:59 |
| | PM |
| | |
|---------+---------------------------->
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: [EMAIL PROTECTED]
|
| cc:
|
| Subject: Re: [mp2] Apache::Cookie
|
|
|
|
|
>--------------------------------------------------------------------------------------------------------------------------------------------------|
"Swen Schillig" <[EMAIL PROTECTED]> writes:
> Joe
>
> Thanks for the patch the expiration is working fine now
> even though the test fails :-)
>
>
> t/testall -v
> All APREQ Tests:
> Cookie: ..F.
> Param: ...
> Parsers: ..
>
> 9 tests run: 8 passed, 1 failed, 0 not implemented.
>
> Failed tests in Cookie:
> 1) netscape_cookie: expected
> ---->
> foo=bar; path=/quux; domain=example.com; expires=Thu, 18-Dec-2003
11:51:26
> GMT
> <----
> but saw
> ---->
> foo=bar; path=/quux; domain=example.com; expires=Fri, 17-Dec-2004
11:50:55
> GMT
> <----
The failure shows that apreq_expires is broken also.
The fix is identical - wrap apr_time_from_sec around
the result of apreq_atoi64t.
> While testing this I figured another problem, the secure flag
> is not working either !
Oops!
> But the path and the domain attributes are !
> So maybe you'll find some time to fix this as well :-)
>
> Anyway, thanks for your help and the solution.
>
> BTW, when will the fix be part of the cvs ?
The fixes are ready; what's missing are the corresponding
tests to ensure the bugs don't reappear.
nb- folks can always add more tests to demonstrate
bugs without necessarily having a corresponding fix.
A patch to the test suite which demonstrates a bug
is absolutely the best kind of bug report.
--
Joe Schaefer
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html