You are here

public function CookieJar::flushExpiredCookies in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/browser-kit/CookieJar.php \Symfony\Component\BrowserKit\CookieJar::flushExpiredCookies()

Removes all expired cookies.

3 calls to CookieJar::flushExpiredCookies()
CookieJar::all in vendor/symfony/browser-kit/CookieJar.php
Returns not yet expired cookies.
CookieJar::allValues in vendor/symfony/browser-kit/CookieJar.php
Returns not yet expired cookie values for the given URI.
CookieJar::get in vendor/symfony/browser-kit/CookieJar.php
Gets a cookie by name.

File

vendor/symfony/browser-kit/CookieJar.php, line 243

Class

CookieJar
CookieJar.

Namespace

Symfony\Component\BrowserKit

Code

public function flushExpiredCookies() {
  foreach ($this->cookieJar as $domain => $pathCookies) {
    foreach ($pathCookies as $path => $namedCookies) {
      foreach ($namedCookies as $name => $cookie) {
        if ($cookie
          ->isExpired()) {
          unset($this->cookieJar[$domain][$path][$name]);
        }
      }
    }
  }
}