コード例 #1
0
ファイル: Response.php プロジェクト: aurora-framework/http
 public function deleteCookie(CookieInterface $Cookie)
 {
     $Cookie->setValue('');
     $Cookie->setMaxAge(-1);
     $this->cookies[$Cookie->getName()] = $Cookie;
     return $this;
 }
コード例 #2
0
ファイル: UnsetCookie.php プロジェクト: tomkyle/cookies
 public function __construct(CookieInterface $cookie, &$target_array = null)
 {
     $name = $cookie->getName();
     // Empty cookie itself
     $cookie->setValue(null);
     // Un-populate current superglobals
     if (is_array($target_array)) {
         unset($target_array[$name]);
     } else {
         unset($_COOKIE[$name]);
     }
     // Unset over HTTP
     setcookie($name, null, -1);
 }