close

Spring Session Core

2.3.1.RELEASE

Spring Session Core provides core Spring Session functionality and APIs.

Features

Spring Session makes it trivial to support clustered sessions without being tied to an application container specific solution. It also provides transparent integration with:

  • HttpSession - allows replacing the HttpSession in an application container (i.e. Tomcat) neutral way, with support for providing session IDs in headers to work with RESTful APIs

  • WebSocket - provides the ability to keep the HttpSession alive when receiving WebSocket messages

  • WebSession - allows replacing the Spring WebFlux’s WebSession in an application container neutral way

Adding Spring Session Core to your build

This project uses a Maven BOM (Bill of Materials) and a release train to coordinate versions, e.g. Bean-SR10, Corn-SR2, etc.

Using the BOM with Maven

With Maven, you need to import the BOM first:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.springframework.session</groupId>
      <artifactId>spring-session-bom</artifactId>
      <version>Corn-SR2</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>
  • This example is using Corn-SR2, but you plug in the release train version you need.

  • Notice the use of the <dependencyManagement> section and the import scope.

Next, add your dependencies to the project without a <version>:

<dependencies>
  <dependency>
    <groupId>org.springframework.session</groupId>
    <artifactId>spring-session-core</artifactId>
  </dependency>
</dependencies>

Using the BOM with Gradle

Since Gradle has no first-class support for Maven BOMs, you can use Spring’s Dependency management plugin.

Apply the plugin from Gradle Plugin Portal (update the version if needed):

plugins {
  id 'io.spring.dependency-management' version '1.0.9.RELEASE'
}

Then use it to import the BOM:

dependencyManagement {
  imports {
    mavenBom 'org.springframework.session:spring-session-bom:Corn-SR2'
  }
}

Finally, add a dependency to the project without a version:

dependencies {
  compile 'org.springframework.session:spring-session-core'
}

Spring Boot Config

Spring Initializr

Quickstart Your Project

Bootstrap your application with Spring Initializr.

Documentation

Each Spring project has its own; it explains in great details how you can use project features and what you can achieve with them.
2.3.1.RELEASE CURRENT GA Reference Doc. API Doc.
2.4.0-RC1 PRE Reference Doc. API Doc.
2.2.4.RELEASE GA Reference Doc. API Doc.
2.1.13.RELEASE GA Reference Doc. API Doc.