On this page
11. Upgrading to 2.x
With the new major release version, the Spring Session team took the opportunity to make some non-passive changes. The focus of these changes is to improve and harmonize Spring Session’s APIs, as well as remove the deprecated components.
Spring Session 2.0 requires Java 8 and Spring Framework 5.0 as a baseline, since its entire codebase is now based on Java 8 source code. Refer to guide for Upgrading to Spring Framework 5.x for reference on upgrading Spring Framework.
As a part of the project’s split the modules, the existing spring-session
has been replaced with spring-session-core
module. The spring-session-core
module holds only the common set of APIs and components while other modules contain the implementation of appropriate SessionRepository
and functionality related to that data store. This applies to several existing that were previously a simple dependency aggregator helper modules but with new module arrangement actually carry the implementation:
- Spring Session Data Redis
- Spring Session JDBC
- Spring Session Hazelcast
Also the following modules were removed from the main project repository:
- Spring Session Data MongoDB
- Spring Session Data GemFire
Note that these two have moved to separate repositories, and will continue to be available albeit under a changed artifact names:
ExpiringSession
API has been merged intoSession
APISession
API has been enhanced to make full use of Java 8Session
API has been extended withchangeSessionId
supportSessionRepository
API has been updated to better align with Spring Data method naming conventionsAbstractSessionEvent
and its subclasses are no longer constructable without an underlyingSession
object- Redis namespace used by
RedisOperationsSessionRepository
is now fully configurable, instead of being partial configurable - Redis configuration support has been updated to avoid registering a Spring Session specific
RedisTemplate
bean - JDBC configuration support has been updated to avoid registering a Spring Session specific
JdbcTemplate
bean - Previously deprecated classes and methods have been removed across the codebase
As a part of the changes to HttpSessionStrategy
and it’s alignment to the counterpart from the reactive world, the support for managing multiple users' sessions in a single browser instance has been removed. The introduction of a new API to replace this functionality is under consideration for future releases.