function startSession($sid = null, $adoptSession = false) { // if($sid){ // HTTP_Session::id($sid); // } if (!$sid || strlen($sid) === 0) { $sid = null; } //session name is used for guessing the session id by http_session so pass null. HTTP_Session::start(null, $sid); $newSID = HTTP_Session::id(); if (!$sid || $adoptSession == true) { $this->set($this->sessionVar, "true"); } else { if (!$this->get($this->sessionVar)) { HTTP_Session::destroy(); throw new WebServiceException(WebServiceErrorCode::$SESSIONIDINVALID, "Session Identifier provided is Invalid"); $newSID = null; } } if (!$this->isValid()) { $newSID = null; } $sid = $newSID; return $sid; }
/** * start() * * @access public * @param string $sName * @param string $sId * @return void */ function start($sName = '', $sId = null) { if ('' == $sName) { $sName = session_name(); } parent::start($sName, $sId); }
/** * Initialize session */ static function init($sessionid = false) { if (empty($sessionid)) { HTTP_Session::start(null, null); $sessionid = HTTP_Session::id(); } else { HTTP_Session::start(null, $sessionid); } if (HTTP_Session::isIdle() || HTTP_Session::isExpired()) { return false; } return $sessionid; }