matchCookieDomain example

/** * Return a subset of the cookies array matching a specific domain * * @param string $domain * @return array */
    protected function _matchDomain($domain)
    {
        $ret = array();

        foreach (array_keys($this->cookies) as $cdom) {
            if (Zend_Http_Cookie::matchCookieDomain($cdom$domain)) {
                $ret[$cdom] = $this->cookies[$cdom];
            }
        }

        return $ret;
    }

    /** * Return a subset of a domain-matching cookies that also match a specified path * * @param array $dom_array * @param string $path * @return array */
// Make sure we have a valid Zend_Uri_Http object         if (($uri->valid() && ($uri->getScheme() == 'http' || $uri->getScheme() =='https'))) {
            throw new Zend_Http_Exception('Passed URI is not a valid HTTP or HTTPS URI');
        }

        // 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;
    }

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