public function setCookie($name, $value = null) {
    if ($value === null) {
      $this->browser->removeCookie($name);
    }
    //TODO: set the cookie with domain, not with url, meaning www.aaa.com or .aaa.com
    if ($value !== null) {
      $urlData = parse_url($this->getCurrentUrl());
      $cookie = array("name" => $name, "value" => $value, "domain" => $urlData["host"]);
      $this->browser->setCookie($cookie);
    }
  }
public function setCookie($name, $value = null) {
    if ($value === null) {
      $this->browser->removeCookie($name);
    }
    //TODO: set the cookie with domain, not with url, meaning www.aaa.com or .aaa.com
    if ($value !== null) {
      $urlData = parse_url($this->getCurrentUrl());
      $cookie = array("name" => $name, "value" => $value, "domain" => $urlData["host"]);
      $this->browser->setCookie($cookie);
    }
  }
public function setCookie ( $ name , $ value = null ) { if ( $ value === null ) { $ this -> browser -> removeCookie ( $ name ) ; } //TODO: set the cookie with domain, not with url, meaning www.aaa.com or .aaa.com if ( $ value !== null ) { $ urlData = parse_url ( $ this -> getCurrentUrl ( ) ) ; $ cookie = array ( "name" => $ name , "value" => $ value , "domain" => $ urlData [ "host" ] ) ; $ this -> browser -> setCookie ( $ cookie ) ; } }
Sets a cookie on the browser, if null value then delete it
@param string $name
@param string $value
Sets a cookie on the browser if null value then delete it