database->getConnection()->query('SELECT 1'); $results = $statement->fetchAll(); if (!$this->session->has("healthcheck")) { $this->session->set("healthcheck", true); } $activeSession = $this->session->get("healthcheck"); return $this->json([ 'http' => true, 'database' => (bool) count($results), 'active_session' => $activeSession, ]); } }