Skip to content

Commit

Permalink
Coverage: Don't attempt to set cookie domain when it is "localhost" (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcovtwout committed May 22, 2021
1 parent 0882485 commit 1d9e1a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Codeception/Coverage/Subscriber/LocalServer.php
Expand Up @@ -201,8 +201,13 @@ protected function startCoverageCollection($testName)
// we need to separate coverage cookies by host; we can't separate cookies by port.
$cookieDomain = isset($c3Url['host']) ? $c3Url['host'] : 'localhost';
}

$cookieParams = [];
if ($cookieDomain !== 'localhost') {
$cookieParams['domain'] = $cookieDomain;
}

$this->module->setCookie(self::COVERAGE_COOKIE, $value, ['domain' => $cookieDomain]);
$this->module->setCookie(self::COVERAGE_COOKIE, $value, $cookieParams);

// putting in configuration ensures the cookie is used for all sessions of a MultiSession test

Expand Down

0 comments on commit 1d9e1a2

Please sign in to comment.