넌 충분히 할 수 있어.
사람들이 말했습니다.

용기를 내야해
사람들이 말했습니다.

그래서 나는 용기를 내었습니다.

용기를 내서 이렇게 말했습니다.

나는 못해요

구 스프링 프레임워크에서는

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초

        // ...
    }

 

 

 

+ Recent posts