# redis-session **Repository Path**: qcvip/redis-session ## Basic Information - **Project Name**: redis-session - **Description**: 集群环境下,实现session共享 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-03 - **Last Updated**: 2022-03-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ![img.png](docs/会话保持.png) - 配置session失效时间 - @EnableRedisHttpSession(maxInactiveIntervalInSeconds = 600, redisNamespace = "qc") ## 实现原理 > 核心思路就是将存储在内存中的信息同步到redis中 1. 通过注解EnableRedisHttpSession注入配置类RedisHttpSessionConfiguration,此类会注入RedisIndexedSessionRepository提供redis对session的操作 2. RedisHttpSessionConfiguration继承SpringHttpSessionConfiguration,后者在容器初始化时会注入SessionRepositoryFilter拦截器, 3. 每次请求时会执行SessionRepositoryFilter.doFilterInternal方法拦截处理,最后会把本地session的操作提交到redis中