Esempio n. 1
0
 /**
  * @group IL_Init
  */
 public function testBasicSessionBehaviour()
 {
     global $ilUser;
     include_once "./Services/Authentication/classes/class.ilSession.php";
     $result = "";
     ilSession::_writeData("123456", "Testdata");
     if (ilSession::_exists("123456")) {
         $result .= "exists-";
     }
     if (ilSession::_getData("123456") == "Testdata") {
         $result .= "write-get-";
     }
     $duplicate = ilSession::_duplicate("123456");
     if (ilSession::_getData($duplicate) == "Testdata") {
         $result .= "duplicate-";
     }
     ilSession::_destroy("123456");
     if (!ilSession::_exists("123456")) {
         $result .= "destroy-";
     }
     ilSession::_destroyExpiredSessions();
     if (ilSession::_exists($duplicate)) {
         $result .= "destroyExp-";
     }
     ilSession::_destroyByUserId($ilUser->getId());
     if (!ilSession::_exists($duplicate)) {
         $result .= "destroyByUser-";
     }
     $this->assertEquals("exists-write-get-duplicate-destroy-destroyExp-destroyByUser-", $result);
 }
 protected function adminSync()
 {
     global $ilCtrl, $lng;
     // see ilSession::_writeData()
     $now = time();
     ilSession::_destroyExpiredSessions();
     ilSessionStatistics::aggretateRaw($now);
     ilUtil::sendSuccess($lng->txt("trac_sync_session_stats_success"), true);
     $ilCtrl->redirect($this);
 }
 /**
  * removes sessions that weren't updated for more than gc_maxlifetime seconds
  *
  * @param	integer		$gc_maxlifetime			max lifetime in seconds
  */
 public function gc($gc_maxlifetime)
 {
     return ilSession::_destroyExpiredSessions();
 }