coherence-spring icon indicating copy to clipboard operation
coherence-spring copied to clipboard

Spring Session: Document different way to specify the session timeouts

Open ghillert opened this issue 10 months ago • 0 comments

We should document the various ways to specify session timeouts (expiration of HTTP session entries in the respective Coherence cache). This should also include an explanation of the overriding behavior in case session expiration timeouts are specified in multiple locations:

  1. Setting the expiry via coherence-cache-config.xml

  2. In Spring boot using spring.session.timeout = 10m

  3. Via annotation @EnableCoherenceHttpSession(sessionTimeoutInSeconds = 5)

  4. By extending CoherenceSpringSessionConfiguration

  5. By declaring a SessionRepositoryCustomizer<CoherenceIndexedSessionRepository> bean:

@Bean
public static SessionRepositoryCustomizer<CoherenceIndexedSessionRepository> sessionRepositoryCustomizer() {
  return (sessionRepository) -> {
    sessionRepository.setDefaultMaxInactiveInterval(Duration.ofSeconds(120));
  };
}

ghillert avatar Apr 17 '24 02:04 ghillert