Expires sessions that have timed out.
516248
private void expireSessions(long timestamp) {
    // Iterate through registered sessions.
    for (RaftSession session : sessions.getSessions(primitiveId)) {
      if (session.isTimedOut(timestamp)) {
        log.debug("Session expired in {} milliseconds: {}", timestamp - session.getLastUpdated(), session);
        session = sessions.removeSession(session.sessionId());
        if (session != null) {
          session.expire();
          service.expire(session.sessionId());
        }
      }
    }
  }
28172
@Override
    @Scheduled(fixedRate = REAP_INTERVAL)
    public void removeExpired() {
        final Set<String> reapable = sessions.entrySet().stream()
                .filter(e -> e.getValue().getExpires().isPresent())
                .filter(e -> e.getValue().getExpires().get().isBefore(now()))
                .map(Map.Entry::getKey).collect(toSet());
        reapable.forEach(key -> {
            final FedoraSession s = sessions.get(key);
            if (s != null) {
                try {
                    s.expire();
                } catch (final RepositoryRuntimeException e) {
                    LOGGER.error("Got exception rolling back expired session {}: {}", s, e.getMessage());
                }
            }
            sessions.remove(key);
        });
    }
738559
def expired(self):
        
        if self.timeout is None:
            return False

        return monotonic() - self.start_time > self.timeout
912994
def time_out(self):
        
        _LOGGER.warning('Response timed out %s', self.session.host)
        self.stop()
        self.callback(SIGNAL_FAILED)
95153
private void timeout(long barrierId) {
    if (this.barrierId == barrierId && !broken) {
      broken = true;
      parties.forEach(session -> getSession(session).accept(client -> client.broken(barrierId)));
    }
  }
1003260
public function extendTimeout() {

		// converts to current time zone
		$dateTime  = new \DateTime();
		$startTime = Utilities::convertToDbDatetime($dateTime);
		
		$this->db->exec('UPDATE `sessions` SET `start_time` = ? WHERE `id` = ?', array($startTime, $this->id));
		
	}
777673
function verifyExpiration(initialStart) {
    if (initialStart && global.THORIN_SETUP) return;
    if (opt.removeExpired === false) return;
    let now = new Date(),
      Session = storeObj.model(modelName);
    Session.destroy({
      where: {
        expire_at: {
          lte: now
        }
      },
      logging: false
    }).then((count) => {
      if (count > 0) {
        logger.trace(`Removed ${count} expired sessions.`);
      }
    }).catch((e) => {
      logger.warn('Failed to perform session cleanup', e);
      logger.trace(e.message);
    }).finally(() => setTimeout(() => verifyExpiration(), CLEANUP_TIMER));
  }
1308291
protected void flushSessions ()
    {
        List<PresentsSession> victims = Lists.newArrayList();
        long now = System.currentTimeMillis();

        // first build a list of our victims
        synchronized (_usermap) {
            for (PresentsSession session : _usermap.values()) {
                if (session.checkExpired(now)) {
                    victims.add(session);
                }
            }
        }

        // now end their sessions
        for (PresentsSession session : victims) {
            try {
                log.info("Session expired, ending session", "session", session,
                         "dtime", (now-session.getNetworkStamp()) + "ms].");
                session.endSession();
            } catch (Exception e) {
                log.warning("Choke while flushing session", "victim", session, e);
            }
        }
    }
824766
def _expire_data(self):
        
        expire_time_stamp = time.time() - self.expire_time
        self.timed_data   = {d: t for d, t in self.timed_data.items()
                             if t > expire_time_stamp}
88243
def __continue_session(self):
        
        now = time.time()
        diff = abs(now - self.last_request_time)
        timeout_sec = self.session_timeout * 60  # convert minutes to seconds

        if diff >= timeout_sec:
            self.__log('Session timed out, attempting to authenticate')
            self.authenticate()
702577
def expire(key, seconds, host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    return server.expire(key, seconds)
907259
function _getExpiredTimeouts(time) {
    var i = 0;
    while (i < timeouts.length && ((timeouts[i].time <= time) || !isFinite(timeouts[i].time))) {
      i++;
    }
    var expired = timeouts.splice(0, i);

    if (deterministic == false) {
      // the array with expired timeouts is in deterministic order
      // shuffle them
      util.shuffle(expired);
    }

    return expired;
  }
713471
def expired(self):
    """"""
    expiry_time = self.expiry_time
    if expiry_time is not None:
      return expiry_time < rdfvalue.RDFDatetime.Now()
    else:
      return False
453413
protected function autoExpire()
    {
        $lastActivitySecondsAgo = $this->now - $this->lastActivityTimestamp;
        $expired = false;
        if ($this->inactivityTimeout !== 0 && $lastActivitySecondsAgo > $this->inactivityTimeout) {
            $this->started = true;
            $this->sessionIdentifier = $this->sessionCookie->getValue();
            $this->destroy(sprintf('Session %s was inactive for %s seconds, more than the configured timeout of %s seconds.', $this->sessionIdentifier, $lastActivitySecondsAgo, $this->inactivityTimeout));
            $expired = true;
        }
        return $expired;
    }
792420
def _end_sessions(self, session_ids):
        """"""
        try:
            # Use SocketInfo.command directly to avoid implicitly creating
            # another session.
            with self._socket_for_reads(
                    ReadPreference.PRIMARY_PREFERRED,
                    None) as (sock_info, slave_ok):
                if not sock_info.supports_sessions:
                    return

                for i in range(0, len(session_ids), common._MAX_END_SESSIONS):
                    spec = SON([('endSessions',
                                 session_ids[i:i + common._MAX_END_SESSIONS])])
                    sock_info.command(
                        'admin', spec, slave_ok=slave_ok, client=self)
        except PyMongoError:
            # Drivers MUST ignore any errors returned by the endSessions
            # command.
            pass
319476
function expireSessionIDs(){
    var tssec = Date.now();
    var expired = [];
    for(var sid in sessionIDs){
        if(sessionIDs[sid] < (tssec + 500)){
            expired.push(sid);
        }
    }
    for(var i=0;i<expired.length;i++){
        delete sessionIDs[expired[i]];
        debug('Session ID expired: %s', expired[i]);
    }
}
507117
def reap_expired_sessions
      @timestamps.each do |session_id,stamp|
        delete_session(session_id) if (stamp + @session_ttl) < Time.now 
      end
      GC.start
    end