# HttpSessionConfig.java

    package cloud.wconnect.frontoffice.config;

    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
    import org.springframework.session.web.http.HeaderHttpSessionIdResolver;
    import org.springframework.session.web.http.HttpSessionIdResolver;

    /**
     * 配置类：Spring Session相关配置
     *
     * @author chenx
     * @date 2021/2/24
     */
    @Configuration
    @EnableRedisHttpSession(maxInactiveIntervalInSeconds = 86400, redisNamespace = "wconnect")
    public class HttpSessionConfig {
        @Bean
        public HttpSessionIdResolver httpSessionIdResolver() {
            return HeaderHttpSessionIdResolver.xAuthToken();
        }
    }