code: public void doLogout(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
          if (!common.checkPost(request, response)) return;
          request.getSession().removeAttribute("logged-in-username");
          response.sendRedirect("/");
      }
docs: Logout form handler.