I am looking at moving user session from the application level to a Redis instance. I believe I have everything set up correctly according to the documentation (http://docs.spring.io/spring-session/docs/current/reference/html5/#httpsession), but I'm not seeing the behavior I'm expecting and thinking that I missed a step somewhere.
The application currently uses HttpSession, so I simply added the following to the context:
<context:annotation-config/>
<util:constant static-field="org.springframework.session.data.redis.config.ConfigureRedisAction.NO_OP"/>
<beans:bean class="org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration"/>
<beans:bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:host-name="HOSTNAME" p:port="6379" />
Added the following to web.xml:
<filter>
<filter-name>springSessionRepositoryFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSessionRepositoryFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
The application builds, deploys, and loads the page fine, but when I look at the cookies on the page, I have both JSESSIONID and SESSION. JSESSIONID I know is used by Spring Security, and it looks like SESSION is used by Spring Session. When I look inside redis, it looks like SESSION is the one being stored.
Another problem is that custom session objects (added using session.setAttribute) are not showing up in the session. The only thing that shows up in the session is AFTER logging in, and is the SPRING_SECURITY_CONTEXT object. When I remove the Spring Session filter, those objects are added to the session just fine.
Is this normal behavior, or do I have some strange conflict due to my setup?