dagolden / HTTP-CookieJar

A minimalist HTTP user agent cookie jar
2 stars 7 forks source link

"Future" test for Expiry fails #11

Closed uncleawie closed 3 years ago

uncleawie commented 3 years ago

It looks like the test in examples.t is hard corded to a future date that is no longer in the future

$jar->add( $req, "lang=en-US; Expires=Wed, 09 Jun 2021 10:18:14 GMT" );

This works but I cannot see how to avoid the fact that 9 June won't be a Wednesday. Is the DoW actually validated?

#Check a date two years in the future
 $jar->add( $req,  sprintf('lang=en-US; Expires=Wed, 09 Jun %04d 10:18:14 GMT', 1970 + (time/365.25/24/60/60) + 2 );