Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CookieJar.php

function 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 206

Class

CookieJar
CookieJar.

Namespace

Symfony\Component\BrowserKit

Code

public function flushExpiredCookies() : void {
    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]);
                }
            }
        }
    }
}
RSS feed
Powered by Drupal