JSP2008. 11. 9. 15:34
생성
 String cookieName = "myCookie";
 Cookie cookie = new Cookie(cookieName, "Apple");
 cookie.setMaxAge(60);
 cookie.setValue("Melone");
 response.addCookie(cookie);

이용
<%
 Cookie[] cookies = request.getCookies();
 if(cookies!=null){
  for(int i=0; i<cookies.length;i++){
   if(cookies[i].getName().equals("myCookie")){
%>
    Cookie Name : <%=cookies[i].getName()%><br />
    Cookie Value: <%=cookies[i].getValue()%><br />
<%
   }
  }
 }
%>
Posted by 아마데우스