function sessions() { if (!$this->isValidApiSession()) { return $this->sendInvalidApiSession(); } if ($this->request->isGET()) { return $this->sendData(array("count" => AuthSession::get()->filter(array("MemberID" => $this->restfulSession->Member()->ID))->Count())); } else { if ($this->request->isDELETE()) { AuthSession::get()->filter(array("MemberID" => $this->restfulSession->Member()->ID))->removeAll(); return $this->sendSuccessfulDelete(); } } }
static function find_by_accesstoken($token) { return AuthSession::get()->filter(array('UID' => $token, 'ValidUntil:GreaterThan' => time()))->First(); }