Exemplo n.º 1
0
        }
    }
    if (in_array($session->status, array(Session::SESSION_STATUS_CREATING, Session::SESSION_STATUS_CREATED, Session::SESSION_STATUS_INIT, Session::SESSION_STATUS_READY))) {
        if ($session->start_time < time() - DEFAULT_UNUSED_SESSION_DURATION) {
            Logger::info('main', '(minutely cron) Session \'' . $session->id . '\' was never used, ending...');
            $session->orderDeletion(true, Session::SESSION_END_STATUS_UNUSED);
        }
    }
    if (in_array($session->status, array(Session::SESSION_STATUS_ACTIVE))) {
        if (!$session->isAlive()) {
            Logger::info('main', '(minutely cron) Session \'' . $session->id . '\' does not exist anymore, purging...');
            $session->orderDeletion(false, Session::SESSION_END_STATUS_ERROR);
        }
    }
    if ($session->status == Session::SESSION_STATUS_DESTROYED) {
        if (!Abstract_Session::uptodate($session)) {
            Logger::info('main', '(minutely cron) Session \'' . $session->id . '\' does not exist anymore, purging...');
            $session->orderDeletion(false, Session::SESSION_END_STATUS_ERROR);
            Abstract_Session::delete($session->id);
        }
    }
    if (in_array($session->status, array(Session::SESSION_STATUS_WAIT_DESTROY, Session::SESSION_STATUS_DESTROYING))) {
        if (array_key_exists('stop_time', $session->settings) && $session->settings['stop_time'] + DESTROYING_DURATION < time()) {
            Logger::info('main', '(minutely cron) Session \'' . $session->id . '\' do not respond, purging...');
            $session->orderDeletion(false, Session::SESSION_END_STATUS_ERROR);
            Abstract_Session::delete($session->id);
        }
    }
}
//END Sessions expiration
exit(0);
Exemplo n.º 2
0
 public function uptodateAttribute($attrib_)
 {
     // 		Logger::debug('main', 'Starting Session::uptodateAttribute for \''.$this->id.'\' attribute '.$attrib_);
     $buf = Abstract_Session::uptodate($this);
     return $buf;
 }