/** * Logout User and Send Url for redirect */ public function logout() { if (isset($_SESSION['gameID']) && $_SESSION['gameID'] != 0) { include_once 'controller/Gamer.php'; $gamer = new Gamer(); $gamer->EndGame(); } session_destroy(); return json_encode(array("uri" => Uri::getAction('Login', 'getMain'))); }