user1321466
user1321466

Reputation: 1959

Spring session with in memory store

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();
  }

Upvotes: 8

Views: 8259

Answers (1)

user1321466
user1321466

Reputation: 1959

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<>());
    }
}

Upvotes: 18

Related Questions