Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.0 RC3
-
Fix Version/s: 1.9.0
-
Component/s: Zend_Http_CookieJar
-
Labels:None
Description
If using $path="/a/b/",the cookie which exsits in the path "/a/b/" will be filtered.
for example:
<?php
require_once('Zend/Http/Client.php');
require_once('Zend/Http/CookieJar.php');
$params=array('continue'=>'https://www.google.com:443/a/yourdomain.com/Dashboard',
'service'=>'CPanel',
'persistent'=>'true',
'at'=>'null',
'userName'=>'admin',
'password'=>'****'
);
$client=new Zend_Http_Client();
$client->setCookieJar();
$client->setUri('https://www.google.com/a/yourdomain.com/LoginAction');
$client->setParameterPost($params);
$client->request('POST');
The example can not send correct Cookie.The cookie in path of "a/yourdomain.com/LoginAction/" will be lost.
if i fixed Zend_Http_Cookiejar using this codes as follows:
protected function _matchPath($domains, $path) { $ret = array(); foreach ($domains as $dom => $paths_array) { foreach (array_keys($paths_array) as $cpath) { $regex = "|^" . preg_quote($cpath, "|") . "|i"; if (preg_match($regex, $path."/") { //I changed the line if (! isset($ret[$dom])) $ret[$dom] = array(); $ret[$dom][$cpath] = &$paths_array[$cpath]; } } } return $ret; }
The example will return right result.
Assigned to Shahar.