[wp-trac] [WordPress Trac] #14191: The test() function of the cookie class does not allow session cookies
WordPress Trac
wp-trac at lists.automattic.com
Sat Jul 7 03:55:57 UTC 2012
#14191: The test() function of the cookie class does not allow session cookies
-------------------------------------+-----------------------
Reporter: mailnew2ster | Owner: dd32
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 3.5
Component: HTTP | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch needs-testing |
-------------------------------------+-----------------------
Changes (by dd32):
* owner: => dd32
* status: new => accepted
* milestone: Future Release => 3.5
Comment:
While testing this, I've just noticed that WP_Http_Cookie::test() is never
actually used by core, or WP_HTTP itself.
The following code works fine at present without this change:
{{{
$one = wp_remote_get( 'http://tools.dd32.id.au/wordpress/cookie-test.php'
);
$two = wp_remote_get( 'http://tools.dd32.id.au/wordpress/cookie-test.php',
array( 'cookies' => $one['cookies'] ) );
var_dump( $one, $two );
}}}
The 2nd request is sent with the cookies returned from request 1, However,
If you wish to validate the cookies can be sent to the 2nd/new
destination, then calling $cookie->test() would still fail.
Looking at testing it, and the attached patch, nacin was right that only
the 2nd chunk was required, While the first chunk of diff is nice to
"clean up" the existing code, there's some bugs that need fixing which
would be harder with the cleanup.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14191#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list