27 #require_once 'Zend/Uri/Http.php'; 112 if (preg_match(
"/[=,; \t\r\n\013\014]/",
$name)) {
113 #require_once 'Zend/Http/Exception.php'; 114 throw new Zend_Http_Exception(
"Cookie name cannot contain these characters: =,; \\t\\r\\n\\013\\014 ({$name})");
118 #require_once 'Zend/Http/Exception.php'; 122 if (! $this->domain = (
string)
$domain) {
123 #require_once 'Zend/Http/Exception.php'; 203 if ($now ===
null) $now =
time();
204 if (is_int($this->expires) && $this->expires < $now) {
218 return ($this->expires ===
null);
229 public function match($uri, $matchSessionCookies =
true, $now =
null)
231 if (is_string ($uri)) {
232 $uri = Zend_Uri_Http::factory($uri);
236 if (! ($uri->valid() && ($uri->getScheme() ==
'http' || $uri->getScheme() ==
'https'))) {
237 #require_once 'Zend/Http/Exception.php'; 242 if ($this->secure && $uri->getScheme() !=
'https')
return false;
243 if ($this->
isExpired($now))
return false;
247 if (! self::matchCookieDomain($this->
getDomain(), $uri->getHost())) {
252 if (! self::matchCookiePath($this->
getPath(), $uri->getPath())) {
268 if ($this->encodeValue) {
269 return $this->
name .
'=' . urlencode($this->
value) .
';';
271 return $this->
name .
'=' . $this->
value .
';';
287 if (is_string($refUri)) {
288 $refUri = Zend_Uri_Http::factory($refUri);
297 $parts = explode(
';', $cookieStr);
300 if (strpos($parts[0],
'=') ===
false)
return false;
303 list(
$name,
$value) = explode(
'=', trim(array_shift($parts)), 2);
310 if ($refUri instanceof Zend_Uri_Http) {
312 $path = $refUri->getPath();
317 foreach ($parts as $part) {
319 if (strtolower($part) ==
'secure') {
324 $keyValue = explode(
'=', $part, 2);
325 if (count($keyValue) == 2) {
326 list($k, $v) = $keyValue;
327 switch (strtolower($k)) {
329 if((
$expires = strtotime($v)) ===
false) {
337 #require_once 'Zend/Date.php'; 340 $expires = $expireDate->getTimestamp();
379 if (! $cookieDomain) {
380 #require_once 'Zend/Http/Exception.php'; 385 #require_once 'Zend/Http/Exception.php'; 389 $cookieDomain = strtolower($cookieDomain);
390 $host = strtolower($host);
392 if ($cookieDomain[0] ==
'.') {
393 $cookieDomain = substr($cookieDomain, 1);
397 return ($cookieDomain == $host ||
398 preg_match(
'/\.' . preg_quote($cookieDomain) .
'$/', $host));
413 #require_once 'Zend/Http/Exception.php'; 418 #require_once 'Zend/Http/Exception.php'; 422 return (strpos(
$path, $cookiePath) === 0);
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
__construct($name, $value, $domain, $expires=null, $path=null, $secure=false)
match($uri, $matchSessionCookies=true, $now=null)
static fromString($cookieStr, $refUri=null, $encodeValue=true)
static matchCookiePath($cookiePath, $path)
static matchCookieDomain($cookieDomain, $host)