Every time springboot gets session, it's different.

the springboot project takes the session, and stuffs something into it.
Why is there nothing in the attribute in the session I get every time?
Code:

@ RestController
public class Controller {

public void a(HttpSession session) throws InterruptedException {
    Object obj = session.getAttribute("asasa");
    if (obj==null) {
        session.setAttribute("asasa","121212");
    }



}

}

it"s so depressing.

Jul.19,2021

when processing cross-domain requests:

@Configuration
public class MyConfigration implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowedMethods("GET", "HEAD", "POST","PUT", "DELETE", "OPTIONS")
                .allowCredentials(true) //true
                .maxAge(3600);;
    }
}

when sending a request:

vue project settings: axios.defaults.withCredentials = true

Jquery project settings:

  

whether the front-end AJAX framework uses fetch? Fetch makes requests without jsessionId by default, so it will cause session invalidation.

Menu