springboot the session shared

SpringBoot集成springsession

1. Introducing a dependent (Gradle embodiment)

dependencies {
    compile('org.springframework.boot:spring-boot-starter-data-redis')
    compile('org.springframework.session:spring-session-data-redis')
}

2.application.properties attribute configuration file

# Specify the default session cache mode, redis, the need to configure redis omitted here 
spring.session.store-type = redis

3. Add configuration class, use @EnableRedisHttpSession to open the spring session support

@Configuration  
@EnableRedisHttpSession  
public class RedisSessionConfig {  
} 

from:https://www.cnblogs.com/soul-wonder/p/9668790.html

Published 449 original articles · won praise 2 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_37769323/article/details/104686681