Session not persisted between Spring Boot (Spring Session + MySQL) and Angular frontend
I am using Spring Boot 2.7.18 with Spring Session and MySQL to store sessions in the database, and my frontend is built with Angular. After logging in and being redirected back to my Angular app, the session ID changes, and a new session is created in both the browser (under the “Application” tab) and the MySQL database. This happens even though I expect the same session to persist between requests, causing the session to be recreated every time the user is redirected, which breaks session persistence.
Force-logout from Spring Webflux application after session timeout?
So I have a Spring boot app that runs on two services, one is a gateway with spring-cloud-gateway, webflux and spring-session, and the other is a resource server. They are authenticated with OAuth2 SSO. Basically my problem is I am trying to introduce a forced user logout to the app that triggers after a certain amount of inactivity. First I tried using the server.servlet.session.timeout=60s
property in my application properties but that does not seem to trigger a logout. What I want exactly is when the session expires due to inactivity for the server to redirect to the ‘/logout’ endpoint and log the user out due to inactivity.
Force-logout from Spring Webflux application after session timeout?
So I have a Spring boot app that runs on two services, one is a gateway with spring-cloud-gateway, webflux and spring-session, and the other is a resource server. They are authenticated with OAuth2 SSO. Basically my problem is I am trying to introduce a forced user logout to the app that triggers after a certain amount of inactivity. First I tried using the server.servlet.session.timeout=60s
property in my application properties but that does not seem to trigger a logout. What I want exactly is when the session expires due to inactivity for the server to redirect to the ‘/logout’ endpoint and log the user out due to inactivity.