Expires the given session.
524
private void expireSession(RaftSession session) {
    if (expiring.add(session.sessionId())) {
      log.debug("Expiring session due to heartbeat failure: {}", session);
      appendAndCompact(new CloseSessionEntry(raft.getTerm(), System.currentTimeMillis(), session.sessionId().id(), true, false))
          .whenCompleteAsync((entry, error) -> {
            if (error != null) {
              expiring.remove(session.sessionId());
              return;
            }

            appender.appendEntries(entry.index()).whenComplete((commitIndex, commitError) -> {
              raft.checkThread();
              if (isRunning()) {
                if (commitError == null) {
                  raft.getServiceManager().<Long>apply(entry.index())
                      .whenCompleteAsync((r, e) -> expiring.remove(session.sessionId()), raft.getThreadContext());
                } else {
                  expiring.remove(session.sessionId());
                }
              }
            });
          }, raft.getThreadContext());
    }
  }
175263
def set_session_value(self, name, value):
        """"""

        self.redis().hset(self._session_key, name, value)
        self._update_session_expiration()
31967
function expire() {
  var dbs = this._store.databases, i;
  for(i in dbs) {
    dbs[i].delExpiredKeys();
  }
}
1071575
def on_expiration(self, session, expired_session_exception=None,
                      session_key=None):
        
        if (expired_session_exception and session_key):
            try:
                self.on_change(session)
                msg = "Session with id [{0}] has expired.".\
                    format(session.session_id)
                logger.debug(msg)

                identifiers = session.get_internal_attribute('identifiers_session_key')

                mysession = session_tuple(identifiers, session_key.session_id)

                self.notify_event(mysession, 'SESSION.EXPIRE')
            except:
                raise
            finally:
                self.after_expired(session)
        elif not expired_session_exception and not session_key:
            self.on_change(session)

        # Yosai adds this exception handling
        else:
            msg = "on_exception takes either 1 argument or 3 arguments"
            raise ValueError(msg)
239731
private void expireOrphanSessions(long timestamp) {
    // Iterate through registered sessions.
    for (RaftSession session : raft.getSessions().getSessions()) {
      if (session.getService().deleted() && session.isTimedOut(timestamp)) {
        logger.debug("Orphaned session expired in {} milliseconds: {}", timestamp - session.getLastUpdated(), session);
        session = raft.getSessions().removeSession(session.sessionId());
        if (session != null) {
          session.expire();
        }
      }
    }
  }
49743
private function sessionExpiry()
    {
        $dateTime = new DateTime();
        if (null !== $this->sessionOptions['SessionExpiry']) {
            $expiryDateTime = new DateTime($_SESSION['Expiry']);
            $expiryDateTime->add(new DateInterval($this->sessionOptions['SessionExpiry']));
            if ($expiryDateTime < $dateTime) {
                $this->destroy();
            }
        }
    }
607822
public void expire(long time) {
    long calculatedSize = 0;
    Iterator<Bar> it = bars.iterator();
    while (it.hasNext()) {
      long barSize = it.next().expire(time);
      if (barSize == 0) {
        it.remove();
      }
      calculatedSize += barSize;
    }
    this.size = calculatedSize;
    if (bars.isEmpty()) {
      bars.add(new Bar(barEpsilon, window));
    }
  }
648667
public function expireNow($sessionId)
    {
        if ($sessionInformation = $this->getSessionInformation($sessionId)) {
            $sessionInformation->expireNow();
            $this->saveSessionInformation($sessionInformation);
        }
    }
1132084
def expire_at(self, key, _time):
        
        return self._client.expireat(self.get_key(key), round(_time))
266528
protected final Date getExpirationDate() {
        if (sessionTracker != null) {
            Session currentSession = sessionTracker.getOpenSession();
            return (currentSession != null) ? currentSession.getExpirationDate() : null;
        }
        return null;
    }
948086
private void applyExpire(ExpireOperation operation) {
    context.setTimestamp(operation.timestamp());
    PrimaryBackupSession session = context.getSession(operation.session());
    if (session != null) {
      context.expireSession(session.sessionId().id());
    }
  }
866989
private void saveSession(Session session) throws UnknownSessionException {
		if (session == null || session.getId() == null) {
			logger.error("session or session id is null");
			throw new UnknownSessionException("session or session id is null");
		}
		byte[] key;
		byte[] value;
		try {
			key = keySerializer.serialize(getRedisSessionKey(session.getId()));
			value = valueSerializer.serialize(session);
		} catch (SerializationException e) {
			logger.error("serialize session error. session id=" + session.getId());
			throw new UnknownSessionException(e);
		}
		if (expire == DEFAULT_EXPIRE) {
			this.redisManager.set(key, value, (int) (session.getTimeout() / MILLISECONDS_IN_A_SECOND));
			return;
		}
		if (expire != NO_EXPIRE && expire * MILLISECONDS_IN_A_SECOND < session.getTimeout()) {
			logger.warn("Redis session expire time: "
					+ (expire * MILLISECONDS_IN_A_SECOND)
					+ " is less than Session timeout: "
					+ session.getTimeout()
					+ " . It may cause some problems.");
		}
		this.redisManager.set(key, value, expire);
	}
361999
public void cache(String key, Object obj, int expiration) {
        H.Session session = this.session;
        if (null != session) {
            session.cache(key, obj, expiration);
        } else {
            app().cache().put(key, obj, expiration);
        }
    }
279321
public void sessionExpiryTimeSet(ISession session, long old, long newone) {
        // ArrayList sessionStateObservers = null;

        /*
         * Check to see if there is a non-empty list of sessionStateObservers.
         */
        if (_sessionStateObservers == null || _sessionStateObservers.size() < 1) {
            return;
        }

        // synchronized(_sessionStateObservers) {
        // sessionStateObservers = (ArrayList)_sessionStateObservers.clone();
        // }

        ISessionStateObserver sessionStateObserver = null;
        for (int i = 0; i < _sessionStateObservers.size(); i++) {
            sessionStateObserver = (ISessionStateObserver) _sessionStateObservers.get(i);
            sessionStateObserver.sessionExpiryTimeSet(session, old, newone);
        }
    }
792620
def expire_at(time)
      time = (time.to_f * 1000).floor
      return coerce_bool(self.connection.pexpireat(@key, time))
    end
1281336
def expireat(self, key, when):
        """"""
        expire_time = datetime.fromtimestamp(when)
        key = self._encode(key)
        if key in self.redis:
            self.timeouts[key] = expire_time
            return True
        return False
157159
func (s *Service) ExpireSession(ctx context.Context, key string) error {
	return nil
}