spring-session-data-redis/src/main/java/org/springframework/session/data/redis/RedisOperationsSessionRepository.java
private RedisSession getSession(String id, boolean allowExpired) {
		Map<Object, Object> entries = getSessionBoundHashOperations(id).entries();
		if (entries.isEmpty()) {
			return null;
		}
		MapSession loaded = loadSession(id, entries);
		if (!allowExpired && loaded.isExpired()) {
			return null;
		}
		RedisSession result = new RedisSession(loaded);
		result.originalLastAccessTime = loaded.getLastAccessedTime();
		return result;
	}
private RedisSession getSession(String id, boolean allowExpired) {
		Map<Object, Object> entries = getSessionBoundHashOperations(id).entries();
		if (entries.isEmpty()) {
			return null;
		}
		MapSession loaded = loadSession(id, entries);
		if (!allowExpired && loaded.isExpired()) {
			return null;
		}
		RedisSession result = new RedisSession(loaded);
		result.originalLastAccessTime = loaded.getLastAccessedTime();
		return result;
	}
private RedisSession getSession ( String id , boolean allowExpired ) { Map < Object , Object > entries = getSessionBoundHashOperations ( id ) . entries ( ) ; if ( entries . isEmpty ( ) ) { return null ; } MapSession loaded = loadSession ( id , entries ) ; if ( ! allowExpired && loaded . isExpired ( ) ) { return null ; } RedisSession result = new RedisSession ( loaded ) ; result . originalLastAccessTime = loaded . getLastAccessedTime ( ) ; return result ; }
Gets the session.
@param id the session id
@param allowExpired if true, will also include expired sessions that have not been
deleted. If false, will ensure expired sessions are not returned.
@return the Redis session
Gets the session .