function CookieJar::getCookieByName
Finds and returns the cookie based on the name
Parameters
string $name cookie name to search for:
Return value
SetCookie|null cookie that was found or null if not found
File
-
vendor/
guzzlehttp/ guzzle/ src/ Cookie/ CookieJar.php, line 88
Class
- CookieJar
- Cookie jar that stores cookies as an array
Namespace
GuzzleHttp\CookieCode
public function getCookieByName(string $name) : ?SetCookie {
foreach ($this->cookies as $cookie) {
if ($cookie->getName() !== null && \strcasecmp($cookie->getName(), $name) === 0) {
return $cookie;
}
}
return null;
}