public function isExpired(): bool
    {
        $maxAge = $this->getAttribute(static::ATTR_MAX_AGE);
        if ($maxAge && time() - $this->getCreatedAt() > $maxAge) {
            return true;
        }

        $expires = $this->getAttribute(static::ATTR_EXPIRES);
        if ($expires && strtotime($expires) < time()) {
            return true;
        }

        return false;
    }
public function isExpired(): bool
    {
        $maxAge = $this->getAttribute(static::ATTR_MAX_AGE);
        if ($maxAge && time() - $this->getCreatedAt() > $maxAge) {
            return true;
        }

        $expires = $this->getAttribute(static::ATTR_EXPIRES);
        if ($expires && strtotime($expires) < time()) {
            return true;
        }

        return false;
    }
public function isExpired ( ) : bool { $ maxAge = $ this -> getAttribute ( static :: ATTR_MAX_AGE ) ; if ( $ maxAge && time ( ) - $ this -> getCreatedAt ( ) > $ maxAge ) { return true ; } $ expires = $ this -> getAttribute ( static :: ATTR_EXPIRES ) ; if ( $ expires && strtotime ( $ expires ) < time ( ) ) { return true ; } return false ; }
Returns true of the current cookie has expired.

Checks the max-age and expires attributes.

@return bool Whether the current cookie has expired
Returns true of the current cookie has expired .