Annotation Interface EnableMongoHttpSession


@Retention(RUNTIME) @Target(TYPE) @Documented @Import(MongoHttpSessionConfiguration.class) public @interface EnableMongoHttpSession
Add this annotation to a @Configuration class to expose the SessionRepositoryFilter as a bean named "springSessionRepositoryFilter" and backed by Mongo. Use collectionName to change default name of the collection used to store sessions.
 
 @Configuration(proxyBeanMethods = false)
 @EnableMongoHttpSession
 public class MongoHttpSessionConfig {

     @Bean
     public MongoOperations mongoOperations() throws UnknownHostException {
         return new MongoTemplate(new MongoClient(), "databaseName");
     }

 }
  
Since:
1.2
  • 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"