File tree Expand file tree Collapse file tree
src/main/java/eu/openanalytics/containerproxy Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343import org .springframework .security .web .session .HttpSessionEventPublisher ;
4444import org .springframework .session .FindByIndexNameSessionRepository ;
4545import org .springframework .session .Session ;
46- import org .springframework .session .data .redis .config .ConfigureRedisAction ;
4746import org .springframework .session .web .http .DefaultCookieSerializer ;
4847import org .springframework .session .security .SpringSessionBackedSessionRegistry ;
4948import org .springframework .web .filter .FormContentFilter ;
@@ -170,6 +169,15 @@ public Health health() {
170169 }
171170 }
172171
172+ /**
173+ * This Bean ensures that User Session are properly expired when using Redis for session storage.
174+ */
175+ @ Bean
176+ @ ConditionalOnProperty (name = "spring.session.store-type" , havingValue = "redis" )
177+ public <S extends Session > SessionRegistry sessionRegistry (FindByIndexNameSessionRepository <S > sessionRepository ) {
178+ return new SpringSessionBackedSessionRegistry <S >(sessionRepository );
179+ }
180+
173181 @ Bean
174182 public HttpSessionEventPublisher httpSessionEventPublisher () {
175183 return new HttpSessionEventPublisher ();
You can’t perform that action at this time.
0 commit comments