Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.4

Bug #8662 Cookies don't get sent if empty url path
Submitted: 2006-09-08 08:43 UTC
From: jarfil at jarfil dot net Assigned: avb
Status: Closed Package: HTTP_Request (version 1.1.0)
PHP Version: 5.1.6 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2006-09-08 08:43 UTC] jarfil at jarfil dot net (Jaroslaw Filiochowski)
Description: ------------ Cookies don't get sent if HTTP_Client->get url has no path section as extracted by Net_URL. HTTP_Request->setURL $_url = Net_URL("http://es.groups.yahoo.com"); assert($_url->path == ""); $_url = Net_URL("http://es.groups.yahoo.com/"); assert($_url->path == "/"); HTTP_Client_CookieManager->passCookies $cookie['path'] = "/"; $_condition = (0 === strpos($url->path, $cookie['path'])); assert( ($url->path == "") && ($_condition == false) ); // <--- BUG assert( ($url->path == "/") && ($_condition == true) ); Test script: --------------- $client = new HTTP_Client(); // no cookies $client->get("http://es.groups.yahoo.com"); // if right user:pass then response sets cookies $client->post("https://login.yahoo.com/config/login", $fields); // BUG: cookies don't get sent $client->get("http://es.groups.yahoo.com"); // FIX: cookies do get sent $client->get("http://es.groups.yahoo.com/"); Expected result: ---------------- Cookies should be sent in both cases.

Comments

 [2006-09-08 08:55 UTC] jarfil at jarfil dot net
 [2006-09-22 05:29 UTC] arailean at squiz dot net (Andrei Railean)
Just tested the patch and it seems to solve my cookie issues.
 [2006-10-08 11:49 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2006-10-10 19:34 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!