You are here

private function CookieJar::removeCookieIfEmpty in Lockr 7.3

If a cookie already exists and the server asks to set it again with a null value, the cookie must be deleted.

Parameters

SetCookie $cookie:

1 call to CookieJar::removeCookieIfEmpty()
CookieJar::setCookie in vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
Sets a cookie in the cookie jar.

File

vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php, line 303

Class

CookieJar
Cookie jar that stores cookies as an array

Namespace

GuzzleHttp\Cookie

Code

private function removeCookieIfEmpty(SetCookie $cookie) {
  $cookieValue = $cookie
    ->getValue();
  if ($cookieValue === null || $cookieValue === '') {
    $this
      ->clear($cookie
      ->getDomain(), $cookie
      ->getPath(), $cookie
      ->getName());
  }
}