src/Cookie/Manager.php
public function setCookie(
        string $scope,
        string $name,
        string $value = "",
        int $expire = 0,
        string $path = "",
        string $domain = "",
        bool $secure = false,
        bool $httponly = false
    ): bool {
        if ($this->canSet($scope)) {
            return setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
        }

        if (isset($_COOKIE[$name])) {
            return setcookie($name, "", time() - 360, $path, $domain, $secure, $httponly);
        }

        return false;
    }
public function setCookie(
        string $scope,
        string $name,
        string $value = "",
        int $expire = 0,
        string $path = "",
        string $domain = "",
        bool $secure = false,
        bool $httponly = false
    ): bool {
        if ($this->canSet($scope)) {
            return setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
        }

        if (isset($_COOKIE[$name])) {
            return setcookie($name, "", time() - 360, $path, $domain, $secure, $httponly);
        }

        return false;
    }
public function setCookie ( string $ scope , string $ name , string $ value = "" , int $ expire = 0 , string $ path = "" , string $ domain = "" , bool $ secure = false , bool $ httponly = false ) : bool { if ( $ this -> canSet ( $ scope ) ) { return setcookie ( $ name , $ value , $ expire , $ path , $ domain , $ secure , $ httponly ) ; } if ( isset ( $ _COOKIE [ $ name ] ) ) { return setcookie ( $ name , "" , time ( ) - 360 , $ path , $ domain , $ secure , $ httponly ) ; } return false ; }
Send a cookie if there is consent. Also deletes cookies for which is no longer consent.

@param string $scope
@param string $name
@param string $value
@param integer $expire
@param string $path
@param string $domain
@param boolean $secure
@param boolean $httponly

@return bool

@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.BooleanArgumentFlag)
Send a cookie if there is consent . Also deletes cookies for which is no longer consent .