diff --git a/WebDriver/Driver.php b/WebDriver/Driver.php index 84f5bee..dd1784f 100644 --- a/WebDriver/Driver.php +++ b/WebDriver/Driver.php @@ -39,7 +39,7 @@ protected function __construct($server_url, $capabilities) { $response = $this->execute("POST", "/session", $payload); // Parse out session id - preg_match("/\nLocation:.*\/(.*)\n/", $response['header'], $matches); + preg_match("/\nLocation:.*\/(.*)\n/", $response['header'] . "\n", $matches); if (!empty($response['body'])) { $additional_info = $response['body']; } else if (!empty($response['header'])) {