[Ivan Diaz] - Add logout path

This commit is contained in:
Ivan Diaz 2016-04-28 21:20:42 -03:00
parent 52dbed0d11
commit b44f6f18dc
3 changed files with 14 additions and 0 deletions

View File

@ -1,11 +1,13 @@
<?php
include 'user/login.php';
include 'user/signup.php';
include 'user/logout.php';
$userControllers = new ControllerGroup();
$userControllers->setGroupPath('/user');
$userControllers->addController(new LoginController);
$userControllers->addController(new SignUpController);
$userControllers->addController(new LogoutController);
$userControllers->finalize();

View File

@ -0,0 +1,11 @@
<?php
class LogoutController extends Controller {
const PATH = '/logout';
public function handler() {
$session = Session::getInstance();
$session->closeSession();
Response::respondSuccess();
}
}

View File

@ -8,6 +8,7 @@ class Session {
}
public function initSession() {
session_cache_limiter(false);
session_start();
}