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