구 스프링 프레임워크에서는
web.xml에
<session-config>
<session-timeout>60</session-timeout>
</session-config>
을 사용해도 되고..
외장형 톰캣일경우에는 server.xml의 maxInactiveInterval 을 설정하면 되지만,
스프링부트 임베디드 톰캣 사용할경우는 못쓸껏이다.
나는 스프링부트 + 시큐리티 조합인데
application.yml
에
server:
servlet:
session:
timeout: 10 (10초)
를 적용해도 안먹힌다..
그러면
시큐리티 컨피그에 추가하면 된다.
public class 너가만든class명
extends SimpleUrlAuthenticationSuccessHandler {
@Override
public void onAuthenticationSuccess(HttpServletRequest request,
HttpServletResponse response,
Authentication authentication)
throws ServletException, IOException {
request.getSession().setMaxInactiveInterval(60); //60초
// ...
}
'프로그래밍 > spring' 카테고리의 다른 글
이클립스 플러그인 폐쇠망 수동설치 (0) | 2022.01.28 |
---|---|
junit 이란? 유의사항 및 어노테이션 (0) | 2022.01.24 |