feat: allow starting session from extenders

master
gbili 5 years ago
parent 1720f8c8da
commit a8813bc325

@ -69,6 +69,12 @@ abstract class WebService
$renderer->render($this->status, $data); $renderer->render($this->status, $data);
} }
protected function startSession()
{
session_save_path(Configuration::get('session.save_path'));
session_start();
}
/** /**
* Determines which method to call based on GET or POST parameters and * Determines which method to call based on GET or POST parameters and
* call it before returning the result. * call it before returning the result.
@ -80,8 +86,7 @@ abstract class WebService
private function call($sendSession = true) private function call($sendSession = true)
{ {
if ($sendSession) { if ($sendSession) {
session_save_path(Configuration::get('session.save_path')); $this->startSession();
session_start();
} }
$params = empty($_GET) ? $_POST : $_GET; $params = empty($_GET) ? $_POST : $_GET;

Loading…
Cancel
Save