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 03:43 UTC Modified: 2006-10-10 14:34 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 03: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 03:55 UTC] jarfil at jarfil dot net
 [2006-09-22 00:29 UTC] arailean at squiz dot net (Andrei Railean)
Just tested the patch and it seems to solve my cookie issues.
 [2006-10-08 06:49 UTC] avb (Alexey Borzov)
Moving the bug to HTTP_Request. I think we should rather address the source of the problem and set the path to '/' in setUrl(), if the path is empty.
 [2006-10-10 14:34 UTC] avb (Alexey Borzov)
Should be fixed in CVS. Please try with the current CVS of HTTP_Request and reopen the bug if the problem persists. Thanks.