示例#1
0
 /**
  * cgi/logout
  */
 public function logoutAction()
 {
     $message = '';
     if (MyTool::hasCookie($this, MyConst::COOKIE_TOKEN)) {
         $message .= "token: " . MyTool::getCookie($this, MyConst::COOKIE_TOKEN) . ',';
         $this->cookies->get(MyConst::COOKIE_TOKEN)->delete();
     }
     if (MyTool::hasCookie($this, MyConst::COOKIE_UID)) {
         $message .= "uid: " . MyTool::getCookie($this, MyConst::COOKIE_UID) . ',';
         $this->cookies->get(MyConst::COOKIE_UID)->delete();
     }
     if (MyTool::hasCookie($this, MyConst::COOKIE_TS)) {
         $message .= "ts: " . MyTool::getCookie($this, MyConst::COOKIE_TS) . ',';
         $this->cookies->get(MyConst::COOKIE_TS)->delete();
     }
     MyTool::setVar($this, MyConst::FIELD_STATUS, MyConst::STATUS_OK);
     MyTool::setVar($this, MyConst::FIELD_MESSAGE, $message);
     return true;
 }