private function isExpired($createTs, $lifetime) {
    if ($lifetime === null) {
      return false;
    }
    $expireDate = (new \DateTime())->setTimeStamp($createTs);
    if (intval($lifetime)) {
      $expireDate = $expireDate->modify('+'.$lifetime.' seconds');
    }
    return $expireDate < new \DateTime();
  }