사용자 정보등의 데이터를 서버에 저장할 때 사용되는 객체
로그인, 장바구니 추가 등 데이터 공유 시
속성 설정
→ setAttribute
속성 삭제
→ removeAttribute
속성 사용
→ getAttribute
모든 속성 삭제
→ invalidate()
<%
//세션에 저장하는 방법
session.setAttribute("msg", "happy day~");
session.setMaxInactiveInterval(60); //60초 유지
%>
<h3>세션값 얻기</h3>
세션값:
<%=session.getAttribute("msg")%>
<br>세션유지시간:
<%=session.getMaxInactiveInterval()%>초
<br>세션 생성시간:
<%=new Date(session.getCreationTime())%>
