matchCookiePath example

// Check that the cookie is secure (if required) and not expired         if ($this->secure && $uri->getScheme() != 'https') return false;
        if ($this->isExpired($now)) return false;
        if ($this->isSessionCookie() && ! $matchSessionCookies) return false;

        // Check if the domain matches         if (! self::matchCookieDomain($this->getDomain()$uri->getHost())) {
            return false;
        }

        // Check that path matches using prefix match         if (! self::matchCookiePath($this->getPath()$uri->getPath())) {
            return false;
        }

        // If we didn't die until now, return true.         return true;
    }

    /** * Get the cookie as a string, suitable for sending as a "Cookie" header in an * HTTP request * * @return string */

    protected function _matchPath($domains$path)
    {
        $ret = array();

        foreach ($domains as $dom => $paths_array) {
            foreach (array_keys($paths_array) as $cpath) {
                if (Zend_Http_Cookie::matchCookiePath($cpath$path)) {
                    if (isset($ret[$dom])) {
                        $ret[$dom] = array();
                    }

                    $ret[$dom][$cpath] = $paths_array[$cpath];
                }
            }
        }

        return $ret;
    }

    
Home | Imprint | This part of the site doesn't use cookies.