protected function ttl($expire) { // relative time in seconds, <30 days if ($expire < 30 * 24 * 60 * 60) { $expire += time(); } return $expire ? $expire - time() : 0; }