import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class AddCookie extends HttpServlet {
	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
				
		response.setContentType("text/html");
		String name = request.getParameter("name");
		if(name == null || name == "")
			return;
			
		Cookie cookie = new Cookie("name", name);
		cookie.setMaxAge(60);
		response.addCookie(cookie);
		
		PrintWriter out = response.getWriter();
		out.print("cookie set");
	}
}