public static function destroy($key = '')
    {
        if (isset($_COOKIE[self::$prefix . $key])) {
            setcookie(self::$prefix . $key, '', time() - 3600, '/');

            return true;
        }

        if (count($_COOKIE) > 0) {
            foreach ($_COOKIE as $key => $value) {
                setcookie($key, '', time() - 3600, '/');
            }

            return true;
        }

        return false;
    }
public static function destroy($key = '')
    {
        if (isset($_COOKIE[self::$prefix . $key])) {
            setcookie(self::$prefix . $key, '', time() - 3600, '/');

            return true;
        }

        if (count($_COOKIE) > 0) {
            foreach ($_COOKIE as $key => $value) {
                setcookie($key, '', time() - 3600, '/');
            }

            return true;
        }

        return false;
    }
public static function destroy ( $ key = '' ) { if ( isset ( $ _COOKIE [ self :: $ prefix . $ key ] ) ) { setcookie ( self :: $ prefix . $ key , '' , time ( ) - 3600 , '/' ) ; return true ; } if ( count ( $ _COOKIE ) > 0 ) { foreach ( $ _COOKIE as $ key => $ value ) { setcookie ( $ key , '' , time ( ) - 3600 , '/' ) ; } return true ; } return false ; }
Empties and destroys the cookies.

@param string $key → cookie name to destroy. Not set to delete all

@return boolean
Empties and destroys the cookies .