Annotation Interface EnableMongoWebSession


@Retention(RUNTIME) @Target(TYPE) @Documented @Import(ReactiveMongoWebSessionConfiguration.class) @Configuration(proxyBeanMethods=false) public @interface EnableMongoWebSession
Add this annotation to a @Configuration class to configure a MongoDB-based WebSessionManager for a WebFlux application. This annotation assumes a ReactorMongoOperations is defined somewhere in the application context. If not, it will fail with a clear error messages. For example:
 
 @Configuration
 @EnableMongoWebSession
 public class SpringWebFluxConfig {

     @Bean
     public ReactorMongoOperations operations() {
         return new MaReactorMongoOperations(...);
     }

 }
  
Since:
2.0
  • Element Details

    • maxInactiveIntervalInSeconds

      int maxInactiveIntervalInSeconds
      The maximum time a session will be kept if it is inactive.
      Returns:
      default max inactive interval in seconds
      Default:
      1800
    • collectionName

      String collectionName
      The collection name to use.
      Returns:
      name of the collection to store session
      Default:
      "sessions"