Spring Session, JSESSIONID, and Server Detection | Generated by AI

Home 2025.09

Let’s break this into two parts: how Spring Session/JSESSIONID works, and how to tell whether Spring is running on Tomcat or Netty.


1. How Spring Session and JSESSIONID Work


2. How to Know Whether Spring Uses Tomcat or Netty

Spring Boot can run with different embedded servers:

Ways to Check:

  1. Look at your dependencies

    • If your pom.xml or build.gradle includes spring-boot-starter-web, it uses Tomcat by default.
    • If it includes spring-boot-starter-webflux, it uses Netty by default.
  2. Check startup logs

    • When the app starts, Spring Boot logs the embedded server.
    • Example (Tomcat):

      Tomcat started on port(s): 8080 (http)
      
    • Example (Netty):

      Netty started on port(s): 8080
      
  3. Check runtime classes

    • In code or via actuator, check what server classes are loaded.
    • Tomcat classes start with org.apache.catalina.
    • Netty classes start with io.netty.

Summary:


Do you want me to also explain how session handling differs between Spring MVC (Tomcat) and Spring WebFlux (Netty)? That’s where the distinction matters most.


Back Donate