lib/WebDriverOptions.php
public function addCookie($cookie)
    {
        if (is_array($cookie)) {
            $cookie = Cookie::createFromArray($cookie);
        }
        if (!$cookie instanceof Cookie) {
            throw new InvalidArgumentException('Cookie must be set from instance of Cookie class or from array.');
        }

        $this->executor->execute(
            DriverCommand::ADD_COOKIE,
            ['cookie' => $cookie->toArray()]
        );

        return $this;
    }
public function addCookie($cookie)
    {
        if (is_array($cookie)) {
            $cookie = Cookie::createFromArray($cookie);
        }
        if (!$cookie instanceof Cookie) {
            throw new InvalidArgumentException('Cookie must be set from instance of Cookie class or from array.');
        }

        $this->executor->execute(
            DriverCommand::ADD_COOKIE,
            ['cookie' => $cookie->toArray()]
        );

        return $this;
    }
public function addCookie ( $ cookie ) { if ( is_array ( $ cookie ) ) { $ cookie = Cookie :: createFromArray ( $ cookie ) ; } if ( ! $ cookie instanceof Cookie ) { throw new InvalidArgumentException ( 'Cookie must be set from instance of Cookie class or from array.' ) ; } $ this -> executor -> execute ( DriverCommand :: ADD_COOKIE , [ 'cookie' => $ cookie -> toArray ( ) ] ) ; return $ this ; }
Add a specific cookie.

@see Cookie for description of possible cookie properties
@param Cookie|array $cookie Cookie object. May be also created from array for compatibility reasons.
@return WebDriverOptions The current instance.
Add a specific cookie .