public class SampleServlet extends HttpServlet {
public void doGet( HttpServletRequest request,
HttpServletResponse response )
throws ServletException,IOException {
Cookie c1 = new Cookie("name01","cookie-data01");
c1.setMaxAge( 60 * 60 );
response.addCookie(c1);
}
}
|