當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Cookie::getPath方法代碼示例

本文整理匯總了PHP中Cookie::getPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP Cookie::getPath方法的具體用法?PHP Cookie::getPath怎麽用?PHP Cookie::getPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cookie的用法示例。


在下文中一共展示了Cookie::getPath方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testCookie

 public function testCookie()
 {
     $cookie = new Cookie('DNR=deleted; expires=Tue, 24-Dec-2013 11:39:14 GMT; path=/; domain=.www.yahoo.com');
     $this->assertEquals('DNR', $cookie->getName());
     $this->assertEquals('deleted', $cookie->getValue());
     $this->assertEquals(date('r', strtotime('Tue, 24-Dec-2013 11:39:14 GMT')), $cookie->getExpires()->format('r'));
     $this->assertEquals('/', $cookie->getPath());
     $this->assertEquals('www.yahoo.com', $cookie->getDomain());
 }
開發者ID:seytar,項目名稱:psx,代碼行數:9,代碼來源:CookieTest.php

示例2: add

 /**
  * Add a cookie to the pool.
  *
  * @param Cookie $cookie A cookie.
  */
 public function add(Cookie $cookie)
 {
     if ($cookie instanceof MutableCookie) {
         $this->cookies[$cookie->getName()] = $cookie;
     } elseif ($cookie instanceof ResponseCookie) {
         $this[$cookie->getName()]->set($cookie->get())->setPath($cookie->getPath())->setDomain($cookie->getDomain())->setSecure($cookie->isSecure())->setHttpOnly($cookie->isHttpOnly())->expiresAt($cookie->getExpiration());
     } else {
         $this->cookies[$cookie->getName()] = $this->setDefaults(new MutableCookie($cookie->getName(), $cookie->get()));
     }
 }
開發者ID:jivoo,項目名稱:http,代碼行數:15,代碼來源:CookiePool.php

示例3: set

 /**
  * Sets a cookie.
  *
  * @param Cookie $cookie A Cookie instance
  *
  * @api
  */
 public function set(Cookie $cookie)
 {
     $this->cookieJar[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;
 }
開發者ID:rouffj,項目名稱:symfony,代碼行數:11,代碼來源:CookieJar.php

示例4: setCookie

 /**
  * Sets a cookie.
  *
  * @param Cookie $cookie
  */
 public function setCookie(Cookie $cookie)
 {
     $this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;
     $this->headerNames['set-cookie'] = 'Set-Cookie';
 }
開發者ID:symfony,項目名稱:symfony,代碼行數:10,代碼來源:ResponseHeaderBag.php

示例5: remove

 /**
  * Remove a specific cookie from storage
  *
  * @param Cookie $cookie
  * @return void
  */
 public function remove(Cookie $cookie)
 {
     unset($this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()]);
 }
開發者ID:amphp,項目名稱:artax,代碼行數:10,代碼來源:ArrayCookieJar.php

示例6: set

 /**
  * Create cookie.
  */
 public function set(Cookie $cookie)
 {
     return setcookie($cookie->getName(), $cookie->getValue(), $cookie->getTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->getSecure(), true);
 }
開發者ID:reshadf,項目名稱:RMProject,代碼行數:7,代碼來源:CookieStorage.php

示例7: isComfortableForUrl

 /**
  * 判斷cookie是否與url適配
  * @param Cookie $cookie
  * @param Url $url
  * @return bool
  */
 protected function isComfortableForUrl(Cookie $cookie, Url $url)
 {
     return $this->matchPath($cookie->getPath(), $url->getPath());
 }
開發者ID:slince,項目名稱:runner,代碼行數:10,代碼來源:CookieContainer.php


注:本文中的Cookie::getPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。