示例#1
0
 /**
  * Logs a user off from the system
  * @return void
  */
 public function logout()
 {
     class_logger::getInstance()->addLogRow("User: "******" successfully logged out", class_logger::$levelInfo);
     class_module_user_log::registerLogout();
     class_core_eventdispatcher::getInstance()->notifyGenericListeners(class_system_eventidentifier::EVENT_SYSTEM_USERLOGOUT, array($this->getUserID()));
     $this->getObjInternalSession()->setStrLoginstatus(class_module_system_session::$LOGINSTATUS_LOGGEDOUT);
     $this->getObjInternalSession()->updateObjectToDb();
     $this->getObjInternalSession()->deleteObjectFromDatabase();
     $this->objInternalSession = null;
     $this->objUser = null;
     if (isset($_COOKIE[session_name()])) {
         setcookie(session_name(), '', time() - 42000);
     }
     // Finally, destroy the session.
     session_destroy();
     //start a new one
     $this->sessionStart();
     //and create a new sessid
     @session_regenerate_id();
     $this->initInternalSession();
     return;
 }