function isValid() { $valid = true; // expired if (HTTP_Session::isExpired()) { $valid = false; HTTP_Session::destroy(); throw new WebServiceException(WebServiceErrorCode::$SESSLIFEOVER, "Session has life span over please login again"); } // idled if (HTTP_Session::isIdle()) { $valid = false; HTTP_Session::destroy(); throw new WebServiceException(WebServiceErrorCode::$SESSIONIDLE, "Session has been invalidated to due lack activity"); } //echo "<br>is new: ", HTTP_Session::isNew(); //invalid sessionId provided. //echo "<br>get: ",$this->get($this->sessionVar); if (!$this->get($this->sessionVar) && !HTTP_Session::isNew()) { $valid = false; HTTP_Session::destroy(); throw new WebServiceException(WebServiceErrorCode::$SESSIONIDINVALID, "Session Identifier provided is Invalid"); } return $valid; }