Hello. I'm having an error on the line:
Cookie cookie = new Cookies(req.getCookies().getUsuarioLogado();
The complete method / class is this:
@WebServlet(urlPatterns = "/logout")
public class Logout extends HttpServlet {
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//String getCookies = req.getParameter(getCookies);
//String getUsuarioLogado = req.getParameter(getUsuarioLogado);
Cookie cookie = new Cookies(req.getCookies().getUsuarioLogado();
if(cookie!=null) {
cookie.setMaxAge(0);
resp.addCookie(cookie);
}
PrintWriter writer = resp.getWriter();
writer.println("<html><body>Logout efetuado</body></html>");
}
}
I can not solve the error. Anyone know?
Thank you