In this example, we will connect Spring Session to use a Redis session store. While the code to put data into session remains the same, the data would be stored to Redis instead of HTTP Session.
There are three simple steps involved:
- Add dependencies for Spring Session.
- Configure Filter to replace HttpSession with Spring Session.
- Enable filtering for Tomcat by extending AbstractHttpSessionApplicationInitializer.