package requestHandlers;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class logoutH implements RequestHandler{

	@Override
	public void processRequest(Object user, HttpServletRequest req,
			HttpServletResponse res, Object[] services, Object log)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		try
		{
			HttpSession session = req.getSession(false);
			if(session != null)
			{
				session.invalidate();
			}
			res.sendRedirect("login.html"); //error page 
		}
		catch (Throwable theException) 	    
		{
		     System.out.println(theException); 
		}
	}

}
