function Selenium2Driver::getCookie
Overrides CoreDriver::getCookie
File
-
vendor/
lullabot/ mink-selenium2-driver/ src/ Selenium2Driver.php, line 531
Class
- Selenium2Driver
- Selenium2 driver.
Namespace
Behat\Mink\DriverCode
public function getCookie(string $name) {
$cookies = $this->getWebDriverSession()
->getAllCookies();
foreach ($cookies as $cookie) {
if ($cookie['name'] === $name) {
// PHP 7.4 changed the way it encodes cookies to better respect the spec.
// This assumes that the server and the Mink client run on the same version (or
// at least the same side of the behavior change), so that the server and Mink
// consider the same value.
if (\PHP_VERSION_ID >= 70400) {
return rawurldecode($cookie['value']);
}
return urldecode($cookie['value']);
}
}
return null;
}