Delete all cookies

@return bool
160930
public static function deleteAllCookies() {
        if(headers_sent($filename, $line)){
            die('<script type="text/javascript">javascript:new function(){var c=document.cookie.split(";");for(var i=0;i<c.length;i++){var e=c[i].indexOf("=");var n=e>-1?c[i].substr(0,e):c[i];document.cookie=n+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT";}}()</script>');
        }

        if (isset($_SERVER['HTTP_COOKIE'])) {
            $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
            foreach($cookies as $cookie) {
                $parts = explode('=', $cookie);
                $name = trim($parts[0]);
                setcookie($name, '', time()-1000);
                setcookie($name, '', time()-1000, '/');
            }

            return true;
        }

        return false;
    }
597758
public void deleteAllCookies() {
        String action = "Deleting all cookies";
        String expected = "All cookies are removed";
        try {
            driver.manage().deleteAllCookies();
        } catch (Exception e) {
            reporter.fail(action, expected, "Unable to remove all cookies. " + e.getMessage());
            log.warn(e);
            return;
        }
        reporter.pass(action, expected, expected);
    }
1163139
public function clearAll()
    {
        $command = $this->driver->factoryCommand('cookie', WebDriver_Command::METHOD_DELETE);
        $this->driver->curl($command);
    }
1063859
public function deleteAll()
    {
        if ($this->loaded()) {
            $this->unload();
        }
        $this->hook('beforeDeleteAll');
        $this->controller->deleteAll($this);
        $this->hook('afterDeleteAll');

        return $this;
    }
387329
public static function clearSession(){
        session_destroy();
        self::$instance->invalidate();
        setcookie(self::$instance->getName(), self::$instance->getId(), time() - 3600 ,'/');
        return true;
    }
737369
public function delete()
    {
        $this->getLogger()->info('Deleting Campaign ID ' . $this->campaignId);
        $this->doDelete($this->url . '/' . $this->campaignId);

        return true;
    }
1040949
public function removeAll()
    {
        $this->_validate();
        if (!$this->isLocked()) {
            $_SESSION[$this->publicStorage]['store'][$this->_namespaceName] = array();
            return true;
        }
        return false;
    }
139181
public function delete($name)
    {
        if ($this->cookies[$name]) {
            unset($this->cookies[$name]);

            return true;
        }

        return false;
    }
840914
public function delete()
    {
        $this->getLogger()->info('Deleting User Group ID ' . $this->groupId);
        $this->doDelete('/group/' . $this->groupId);

        return true;
    }
468083
public function destroy()
    {
        $_SESSION = array();

        if (ini_get('session.use_cookies') and ! headers_sent()) {
            $params = session_get_cookie_params();
            setcookie(session_name(),
                      '',
                      time() - 42000,
                      $params['path'],
                      $params['domain'],
                      $params['secure'],
                      $params['httponly']
            );
        }

        if (! session_destroy()) {
            throw new Exception('Failed to destroy session');
        }

        $this->_setCsrfToken();

        return true;
    }
683976
public function delete()
    {
        if ($this->getCacheBusting()) {
            $this->queryCache()->flush($this->getTable());
        }

        return parent::delete();
    }
954427
public function clear()
    {
        $session = $this->getSessionContainer();
        if (!$session->isSwitchedUser) {
            return false;
        }

        $oldSession = unserialize($session->session);
        $ref        = $session->ref;
        $_SESSION = $oldSession;

        return $ref ? $ref : true;
    }
733687
public function clear(): bool
    {
        //TODO: check the need to call
        clearstatcache();
        
        $dh = @opendir($this->cacheDir);
        if (false === $dh) {
            return false;
        }
        
        while (false !== ($entry = readdir($dh))) {
            $file = $this->cacheDir . '/' . $entry;
            if (is_file($file) && 0 !== strpos($entry, '.')) { //exclude .htaccess
                unlink($file);
            }
        }
        
        closedir($dh);
        
        return true;
    }
1269130
public function destroy(): bool
    {
        if (! $this->isStarted()) {
            $this->start();
        }
        $name = $this->getName();
        $params = $this->getCookieParams();
        $this->clear();
        $destroyed = session_destroy();
        if ($destroyed) {
            call_user_func($this->delete_cookie, $name, $params);
        }

        return $destroyed;
    }
1117919
protected function clearCookies()
    {
        $secure = $this->getTokenCookieSecure();
        Cookie::set($this->getTokenCookieName(), null, null, null, null, $secure);
        Cookie::set($this->getDeviceCookieName(), null, null, null, null, $secure);
        Cookie::force_expiry($this->getTokenCookieName(), null, null, null, null, $secure);
        Cookie::force_expiry($this->getDeviceCookieName(), null, null, null, null, $secure);
    }
1076487
public function deleteAll()
    {
        $this->request->allowMethod(['post', 'delete']);
        $this->BackupManager->deleteAll();
        $this->Flash->success(I18N_OPERATION_OK);

        return $this->redirect(['action' => 'index']);
    }
805265
public static function destroy()
    {
        if (\session_status() !== PHP_SESSION_ACTIVE) {
            return false;
        }
        foreach (\array_keys($_SESSION) as $key) {
            unset($_SESSION[$key]);
        }
        self::$cfgStatic['id'] = null;
        $success = \session_destroy();
        if (!$success) {
            return false;
        }
        /*
            Clear cookie so new session not automatically started on next page load
            If strict mode is enabled... this isn't exactly necessary...  a new id will be used..
            however, we may not want to start a new session
        */
        \setcookie(
            self::$cfgStatic['name'],
            '',
            \time()-60*60*24,
            self::$cfgStatic['cookiePath'],
            self::$cfgStatic['cookieDomain'],
            self::$cfgStatic['cookieSecure'],
            self::$cfgStatic['cookieHttponly']
        );
        return $success;
    }