You are here

public function CookieJar::getCookieByName in Auth0 Single Sign On 8.2

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 95

Class

CookieJar
Cookie jar that stores cookies as an array

Namespace

GuzzleHttp\Cookie

Code

public function getCookieByName($name) {

  // don't allow a non string name
  if ($name === null || !is_scalar($name)) {
    return null;
  }
  foreach ($this->cookies as $cookie) {
    if ($cookie
      ->getName() !== null && strcasecmp($cookie
      ->getName(), $name) === 0) {
      return $cookie;
    }
  }
  return null;
}