/** * Return a subset of a domain-matching cookies that also match a specified path * * @param array $domains * @param string $path * @return array */ protected function _matchPath($domains, $path) { $ret = array(); foreach ($domains as $dom => $pathsArray) { foreach (array_keys($pathsArray) as $cpath) { if (SetCookie::matchCookiePath($cpath, $path)) { if (!isset($ret[$dom])) { $ret[$dom] = array(); } $ret[$dom][$cpath] = $pathsArray[$cpath]; } } } return $ret; }