블로그 이미지
헤이장

Notice

Recent Post

Recent Comment

Recent Trackback

calendar

1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
  • total
  • today
  • yesterday
2009. 7. 27. 13:36 Web/Jsp

< HttpSession 메서드 >

getCreationTime() - 세션 생성 시간
getLastAccessedTime() - 마지막 요청 시간
setMaxInactiveInterval() - 최대허용시간 설정 (초)
getMaxInactiveInterval() - 최대허용시간
invalidate() - 세션 제거

< 타임아웃 설정하기 > - 일정 시간 동안 요청이 없으면 세션을 제거한다 

1. DD에서 전체 세션 타임아웃 설정
      web.xml

<web-app ... >
    <servlet>

         ...
    </servlet>
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
</web-app>

※ 단위는

  

2. 특정 세션만 타임아웃 설정

session.setMaxInactiveInterval(1800);
session.setMaxInactiveInterval(30*60);

※ 단위는

posted by 헤이장