Skip to content

Commit

Permalink
Avoid removing required fields in cookies. (#5470)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joris van Eijden authored and DavertMik committed Apr 21, 2019
1 parent 15281bb commit 2b17a54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Codeception/Module/WebDriver.php
Expand Up @@ -825,13 +825,17 @@ public function setCookie($cookie, $value, array $params = [])
}
}
// #5401 Supply defaults, otherwise chromedriver 2.46 complains.
$params = array_filter($params);
$params += [
$defaults = [
'path' => '/',
'expiry' => time() + 86400,
'secure' => false,
'httpOnly' => false,
];
foreach ($defaults as $key => $default) {
if (empty($params[$key])) {
$params[$key] = $default;
}
}
$this->webDriver->manage()->addCookie($params);
$this->debugSection('Cookies', json_encode($this->webDriver->manage()->getCookies()));
}
Expand Down

0 comments on commit 2b17a54

Please sign in to comment.