본문 바로가기
웹프로그래밍/JSP

세션 설정

by 폴더맨 2024. 6. 8.

세션 설정1

<%@ page contentType="text/html; charset=EUC-KR" %>
<%@ page session = "true" %>
<%
   session.setAttribute("NAME", "Jimmy");
   session.setAttribute("ADDRESS", "Seoul");
%>
<html>
<head>
<title>세션 속성 설정하기</title>
</head>
<body>
<H3>
세션 속성이 설정되었습니다. <BR>
<A HREF="9-3.jsp">여기</A>를 클릭하면 설정된 속성을 확인할 수 있습니다.
</H3>
</body>
</html>

 

세션 설정2

<%@ page contentType="text/html; charset=EUC-KR" %>
<%@ page session = "true" %>
<html>
<head>
<title>세션 속성 확인하기</title>
</head>
<body>
<H3>
NAME : <%= session.getAttribute("NAME") %><BR>
ADDRESS : <%= session.getAttribute("ADDRESS") %><BR>
</H3>

</body>
</html>

'웹프로그래밍 > JSP' 카테고리의 다른 글

세션 생성  (0) 2024.06.08
세션 삭제  (0) 2024.06.08
세션  (0) 2024.06.08
쿠키 로그아웃  (0) 2024.06.08
쿠키 로그인여부  (0) 2024.06.08