public function setCookie(string $name, string $value=null, int $expire=0, string $path='', string $domain='', bool $secure=false, bool $httpOnly=false)
  {
    if ( \array_key_exists($name,$this->cookies) && \is_null($value) ) {
      # Remove the Cookie
      $this->cookies = \array_diff_key($this->cookies,[$name=>'']);
    } else {
      # Set the Cookie
      $this->cookies[$name] = [
        'name'     => $name,
        'value'    => $value,
        'expire'   => $expire,
        'path'     => $path,
        'domain'   => $domain,
        'secure'   => $secure,
        'httpOnly' => $httpOnly
      ];
    }

    return true;
  }
public function setCookie(string $name, string $value=null, int $expire=0, string $path='', string $domain='', bool $secure=false, bool $httpOnly=false)
  {
    if ( \array_key_exists($name,$this->cookies) && \is_null($value) ) {
      # Remove the Cookie
      $this->cookies = \array_diff_key($this->cookies,[$name=>'']);
    } else {
      # Set the Cookie
      $this->cookies[$name] = [
        'name'     => $name,
        'value'    => $value,
        'expire'   => $expire,
        'path'     => $path,
        'domain'   => $domain,
        'secure'   => $secure,
        'httpOnly' => $httpOnly
      ];
    }

    return true;
  }
public function setCookie ( string $ name , string $ value = null , int $ expire = 0 , string $ path = '' , string $ domain = '' , bool $ secure = false , bool $ httpOnly = false ) { if ( \ array_key_exists ( $ name , $ this -> cookies ) && \ is_null ( $ value ) ) { # Remove the Cookie $ this -> cookies = \ array_diff_key ( $ this -> cookies , [ $ name => '' ] ) ; } else { # Set the Cookie $ this -> cookies [ $ name ] = [ 'name' => $ name , 'value' => $ value , 'expire' => $ expire , 'path' => $ path , 'domain' => $ domain , 'secure' => $ secure , 'httpOnly' => $ httpOnly ] ; } return true ; }
Set a cookie for the next response

@param      string        $name      [description]
@param      string|null   $value     [description]
@param      int|integer   $expire    [description]
@param      string        $path      [description]
@param      string        $domain    [description]
@param      bool|boolean  $secure    [description]
@param      bool|boolean  $httpOnly  [description]

@return     mixed
Set a cookie for the next response