/** * This is called on every page hit. * It returns true if the current session is authenticated or false otherwise * * @return booelan */ public function sessionAuthenticate() { if (!$this->authenticated) { $this->authenticated = $this->authController->sessionAuthenticate(); } if ($this->authenticated) { if (!isset($_SESSION['userStats']['pages'])) { $_SESSION['userStats']['loginTime'] = time(); $_SESSION['userStats']['pages'] = 0; } $_SESSION['userStats']['lastTime'] = time(); $_SESSION['userStats']['pages']++; } return $this->authenticated; }