当前位置: 首页>>代码示例>>PHP>>正文


PHP Cookie::getDomain方法代码示例

本文整理汇总了PHP中Cookie::getDomain方法的典型用法代码示例。如果您正苦于以下问题:PHP Cookie::getDomain方法的具体用法?PHP Cookie::getDomain怎么用?PHP Cookie::getDomain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cookie的用法示例。


在下文中一共展示了Cookie::getDomain方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addCookie

 /**
  * @see CookieManager::addCookie()
  */
 public function addCookie(Cookie $cookie)
 {
     $cookieDomain = $cookie->getDomain();
     if (!isset($this->cookies[$cookieDomain])) {
         $this->cookies[$cookieDomain] = array();
     }
     $this->cookies[$cookieDomain][] = $cookie;
 }
开发者ID:imastersdev,项目名称:correios,代码行数:11,代码来源:HTTPCookieManager.php

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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


注:本文中的Cookie::getDomain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。