public function logout() { if ($this->loggedIn) { $this->loggedIn = false; $this->conn->close(); $this->conn = null; } }