import javax.servlet.*; import javax.servlet.http.*; import java.io.*;//for the IOException public class CheckCookie extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp)throws IOException,ServletException { resp.setContentType("text/html"); PrintWriter pw = resp.getWriter(); pw.println("
"); Cookie[] cooks = req.getCookies(); // get cookies from this request which comes form 1st servlet. if(cooks!=null) { for(int i = 0;i