diff --git a/samples/javaconfig/webflux/src/main/java/sample/HelloWebfluxSessionConfig.java b/samples/javaconfig/webflux/src/main/java/sample/HelloWebfluxSessionConfig.java
index 7cf81ed5..05d211bc 100644
--- a/samples/javaconfig/webflux/src/main/java/sample/HelloWebfluxSessionConfig.java
+++ b/samples/javaconfig/webflux/src/main/java/sample/HelloWebfluxSessionConfig.java
@@ -16,6 +16,8 @@
package sample;
+import java.util.concurrent.ConcurrentHashMap;
+
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.EnableSpringWebSession;
@@ -29,7 +31,7 @@ public class HelloWebfluxSessionConfig {
@Bean
public MapReactorSessionRepository reactorSessionRepository() {
- return new MapReactorSessionRepository();
+ return new MapReactorSessionRepository(new ConcurrentHashMap<>());
}
}
// end::class[]
diff --git a/spring-session-core/src/main/java/org/springframework/session/MapReactorSessionRepository.java b/spring-session-core/src/main/java/org/springframework/session/MapReactorSessionRepository.java
index ee9d1976..f02f3058 100644
--- a/spring-session-core/src/main/java/org/springframework/session/MapReactorSessionRepository.java
+++ b/spring-session-core/src/main/java/org/springframework/session/MapReactorSessionRepository.java
@@ -18,7 +18,6 @@ package org.springframework.session;
import java.time.Duration;
import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
import reactor.core.publisher.Mono;
@@ -26,10 +25,10 @@ import org.springframework.session.events.SessionDeletedEvent;
import org.springframework.session.events.SessionExpiredEvent;
/**
- * A {@link SessionRepository} backed by a {@link Map} and that uses a
- * {@link MapSession}. By default a {@link ConcurrentHashMap} is
- * used, but a custom {@link Map} can be injected to use distributed maps
- * provided by NoSQL stores like Redis and Hazelcast.
+ * A {@link ReactorSessionRepository} backed by a {@link Map} and that uses a
+ * {@link MapSession}. The injected {@link java.util.Map} can be backed by a distributed
+ * NoSQL store like Hazelcast, for instance. Note that the supplied map itself is
+ * responsible for purging the expired sessions.
*
*
* The implementation does NOT support firing {@link SessionDeletedEvent} or
@@ -40,6 +39,7 @@ import org.springframework.session.events.SessionExpiredEvent;
* @since 2.0
*/
public class MapReactorSessionRepository implements ReactorSessionRepository {
+
/**
* If non-null, this value is used to override
* {@link Session#setMaxInactiveInterval(Duration)}.
@@ -49,15 +49,8 @@ public class MapReactorSessionRepository implements ReactorSessionRepository