set server.servlet.session.timeout back

This commit is contained in:
Ludy87 2025-03-28 22:22:09 +01:00
parent fe4d2823aa
commit d96d85ed64
No known key found for this signature in database
GPG Key ID: 92696155E0220F94
5 changed files with 6 additions and 6 deletions

View File

@ -24,7 +24,7 @@ import stirling.software.SPDF.config.interfaces.SessionsModelInterface;
@Slf4j
public class AnonymusSessionRegistry implements HttpSessionListener, SessionsInterface {
@Value("${server.servlet.session.timeout:120s}") // TODO: Change to 30m
@Value("${server.servlet.session.timeout:30m}")
private Duration defaultMaxInactiveInterval;
// Map for storing sessions including timestamp

View File

@ -18,11 +18,11 @@ public class AnonymusSessionService {
@Autowired private AnonymusSessionRegistry sessionRegistry;
@Value("${server.servlet.session.timeout:120s}") // TODO: Change to 30m
@Value("${server.servlet.session.timeout:30m}")
private Duration defaultMaxInactiveInterval;
// Runs every minute to expire inactive sessions
@Scheduled(cron = "0 0/1 * * * ?")
@Scheduled(cron = "0 0/5 * * * ?")
public void expireSessions() {
Instant now = Instant.now();
sessionRegistry.getAllSessions().stream()

View File

@ -36,7 +36,7 @@ public class CustomHttpSessionListener implements HttpSessionListener, SessionsI
private final boolean loginEnabled;
private final boolean runningEE;
@Value("${server.servlet.session.timeout:120s}") // TODO: Change to 30m
@Value("${server.servlet.session.timeout:30m}")
private Duration defaultMaxInactiveInterval;
public CustomHttpSessionListener(

View File

@ -29,7 +29,7 @@ public class SessionPersistentRegistry implements SessionRegistry {
private final SessionRepository sessionRepository;
private final boolean runningEE;
@Value("${server.servlet.session.timeout:120s}") // TODO: Change to 30m
@Value("${server.servlet.session.timeout:30m}")
private Duration defaultMaxInactiveInterval;
public SessionPersistentRegistry(

View File

@ -28,7 +28,7 @@ public class SessionScheduled {
this.loginEnabledValue = loginEnabledValue;
}
@Scheduled(cron = "0 0/1 * * * ?")
@Scheduled(cron = "0 0/5 * * * ?")
public void expireSessions() {
Instant now = Instant.now();
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();