Spring boot doesn't save sessions between requests. I have to methods: /login and another one is /getInfo. They're placed in different controllers. DB for sessions is MongoDB and I can see through Mongo Compass that there are adding new sessions documents. So, I'm making post request to /login, where session are creating and after that I'm making request to /getInfo where I want to take data from session and I get This is an screen of session and the data in each sessions(including sessions id). As result I have two different sessions
This is how the session sets:
session.setAttribute("username", resp.get("username"));
This is how data are getting from session:
session.getAttribute("username")