Session Timeout is working fine in the localhost, but when I deploy it on the Linux Server, the timeout doesn't work at all.
Does anyone have an idea what's the issue here?
My configuration in the SecurityConfig is:
http.authorizeRequests()
.antMatchers("/js/**", "/css/**", "/icons/**", "/login/**", "/error").permitAll()
.anyRequest().hasRole("USER")
.and()
.formLogin().loginPage("/login").permitAll()
.and()
.logout().permitAll().logoutSuccessUrl("/login?logout=true").invalidateHttpSession(true).deleteCookies("JSESSIONID")
.and()
.sessionManagement();
with the Beans
@Bean
public SessionRegistry sessionRegistry(){
SessionRegistry sessionRegistry = new SessionRegistryImpl();
return sessionRegistry;
}
@Bean
public HttpSessionEventPublisher httpSessionEventPublisher() {
HttpSessionEventPublisher httpSessionEventPublisher = new HttpSessionEventPublisher();
return httpSessionEventPublisher;
}
And inside the property file:
server.servlet.session.timeout=1m