* Fix session for api.
This commit is contained in:
@@ -1014,9 +1014,6 @@ class baseRouter
|
||||
if($this->config->customSession) session_save_path($this->getTmpRoot() . 'session');
|
||||
if(!session_id()) session_start();
|
||||
|
||||
/* If request header has token, use it as session for authentication. */
|
||||
if(isset($_SERVER['HTTP_TOKEN'])) session_id($_SERVER['HTTP_TOKEN']);
|
||||
|
||||
$this->sessionID = isset($ztSessionHandler) ? $ztSessionHandler->getSessionID() : session_id();
|
||||
|
||||
if(isset($_GET[$this->config->sessionVar]))
|
||||
@@ -1024,6 +1021,11 @@ class baseRouter
|
||||
helper::restartSession($_GET[$this->config->sessionVar]);
|
||||
$this->sessionID = isset($ztSessionHandler) ? $ztSessionHandler->getSessionID() : session_id();
|
||||
}
|
||||
else if(isset($_SERVER['HTTP_TOKEN'])) // If request header has token, use it as session for authentication.
|
||||
{
|
||||
helper::restartSession($_SERVER['HTTP_TOKEN']);
|
||||
$this->sessionID = isset($ztSessionHandler) ? $ztSessionHandler->getSessionID() : session_id();
|
||||
}
|
||||
|
||||
define('SESSION_STARTED', true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user