[Ivan Diaz] - Add logout path
This commit is contained in:
parent
52dbed0d11
commit
b44f6f18dc
|
@ -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();
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
class LogoutController extends Controller {
|
||||
const PATH = '/logout';
|
||||
|
||||
public function handler() {
|
||||
$session = Session::getInstance();
|
||||
$session->closeSession();
|
||||
|
||||
Response::respondSuccess();
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ class Session {
|
|||
}
|
||||
|
||||
public function initSession() {
|
||||
session_cache_limiter(false);
|
||||
session_start();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue