There is no logout method exist in HttpSession
//This code will redirect to homepage.jsp
RequestDispatcher rd = request.getRequestDispatcher("homepage.jsp");
rd.forward(request, response);
You can use session.invalidate();
to invalidate the session