I have this controller
@Controller @RequestMapping(value = \"/login\") public class Login{ @RequestMapping public ModelAndView mainPage(HttpServletReque
Are you using spring security? May be you can set http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER) if you are managing sessions by yourself
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER)
Reference: https://www.baeldung.com/spring-security-session