2016-07-20 06:31:07 +02:00
|
|
|
<?php
|
|
|
|
|
2017-04-16 07:35:04 +02:00
|
|
|
/**
|
2017-04-17 04:59:11 +02:00
|
|
|
* @api {post} /user/check-session Check if session exist or not.
|
2017-04-16 07:35:04 +02:00
|
|
|
*
|
2017-04-17 04:59:11 +02:00
|
|
|
* @apiName check session
|
2017-04-16 07:35:04 +02:00
|
|
|
*
|
|
|
|
* @apiGroup User
|
|
|
|
*
|
|
|
|
* @apiDescription This path give back a object that says if a session exist or not.
|
|
|
|
*
|
|
|
|
* @apiPermission Any
|
|
|
|
*
|
|
|
|
* @apiError {String} message
|
|
|
|
*
|
|
|
|
* @apiSuccess {Object} data
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-07-20 06:31:07 +02:00
|
|
|
class CheckSessionController extends Controller {
|
|
|
|
const PATH = '/check-session';
|
2017-02-08 19:09:15 +01:00
|
|
|
const METHOD = 'POST';
|
2016-07-20 06:31:07 +02:00
|
|
|
|
|
|
|
public function validations() {
|
|
|
|
return [
|
|
|
|
'permission' => 'any',
|
|
|
|
'requestData' => []
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handler() {
|
|
|
|
$session = Session::getInstance();
|
|
|
|
|
|
|
|
Response::respondSuccess([
|
|
|
|
'sessionActive' => $session->sessionExists()
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|