private function determineLifeTime(Request $request)
    {
        if ($lifetime = $request->query->getInt('ttl')) {
            return $this->revertToNullOnMinusOne($lifetime);
        }

        try {
            $inputData = new JsonArray($request->getContent());
            if ($inputData->has('ttl')) {
                return $this->revertToNullOnMinusOne(intval($inputData->get('ttl')));
            }
        } catch (\Exception $e) {
            // Swallow exception, we need to return a defined result.
        }

        return 3600;
    }