Repository navigation
Restore Redis-backed HTTP sessions on Spring Boot 4 - #12530
Merged
dippindots merged 3 commits intoNov 26, 2026
Merged
Conversation
dippindots
force-pushed
the
fix-spring-session-redis
branch
from
November 24, 2026 20:48
a28f919 to
0675dc0
Compare
dippindots
force-pushed
the
fix-spring-session-redis
branch
2 times, most recently
from
November 24, 2026 21:20
c2a42d2 to
b1a9504
Compare
dippindots
marked this pull request as ready for review
November 24, 2026 22:59
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
4 tasks done
Boot 4 moved Spring Session's Redis autoconfiguration into spring-boot-session-data-redis. Without it, --spring.session.store-type=redis has no effect and each pod keeps sessions in memory, which breaks SAML login on deployments with more than one replica.
Lettuce 7.5 (the Redis client behind Spring Session) needs Netty 4.2 (io.netty.channel.MultiThreadIoEventLoopGroup). The 4.1.137.Final pin from the Boot 3.5 era downgraded Boot 4's managed Netty 4.2.15 and broke every session write with NoClassDefFoundError. 4.2.21.Final is the newest 4.2 release and also covers Redisson 4.7.0 (built on 4.2.16).
Adds spring-boot-session and spring-boot-session-data-redis, and moves the Netty artifacts to 4.2.21.Final.
dippindots
force-pushed
the
fix-spring-session-redis
branch
from
November 26, 2026 00:06
b1a9504 to
9d6905c
Compare
This was referenced Nov 26, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since the Spring Boot 4.1 migration (#12361, released in 7.2.4),
--spring.session.store-type=redisand--spring.data.redis.*no longer do anything. Boot 4 moved Spring Session's Redis autoconfiguration (SessionDataRedisAutoConfiguration) into its own module,spring-boot-session-data-redis. Ourpom.xmlhasspring-session-data-redisbut not that module, so Spring Session never starts and Tomcat keeps sessions in each pod's memory.Symptoms on 7.2.7:
JSESSIONIDinstead ofSESSION. Check withcurl -sD- -o /dev/null https://<host>/saml2/authenticate/cbio-saml-idp | grep -i set-cookie./login?error("Invalid credentials") on deployments with more than one replica. The AuthnRequest is saved in one pod's session, and the IdP's response often reaches another pod.Change
Add
org.springframework.boot:spring-boot-session-data-redis. The version comes from the Boot parent (4.1.0).Also moves the
netty.versionoverride from4.1.137.Finalto4.2.21.Final. With Redis sessions active, Spring Session writes through Lettuce 7.5, which needs Netty 4.2 (io.netty.channel.MultiThreadIoEventLoopGroup). The old 4.1 pin downgraded Boot 4's managed Netty 4.2.15, and on msk beta every session save failed withNoClassDefFoundError(HTTP 500). 4.2.21.Final is the newest 4.2 release, at or above both Boot (4.2.15) and Redisson 4.7.0 (4.2.16), so the CVE override still holds.Deployments that don't set
spring.session.store-typeare unchanged:AutoconfigureExcludeConfig.Redisstill excludesDataRedisAutoConfigurationfor them, so there's no Redis connection for sessions to use, the same as on 7.2.3.Testing
mvn dependency:treeresolvesspring-boot-session-data-redis:4.1.0andspring-boot-session:4.1.0SESSION, and SAML login should work on every tryAlso updates
OPEN-SOURCE-DOCUMENTATIONandbom.jsonfor the new dependencies (spring-boot-session,spring-boot-session-data-redis, and Netty 4.2.21.Final). The reports were refreshed on master in Regenerate third-party dependency reports #12532.