Spring session with in memory store

Viewed 5035

Why does not spring.session.store-type has in memory option. ?

Is there any way to use spring session with in memory option without writing my implementation of store ?

I would like to use spring session for rest api with token

 @Bean
  public HttpSessionIdResolver httpSessionIdResolver() {
    return HeaderHttpSessionIdResolver.xAuthToken();
  }
1 Answers

I found solution, there is a MapSessionRepository which can accept map. here is a documentation EnableSpringHttpSession

@EnableSpringHttpSession
@Configuration
public class SpringHttpSessionConfig {
    @Bean
    public MapSessionRepository sessionRepository() {
        return new MapSessionRepository(new ConcurrentHashMap<>());
    }
}
Related