package org.ibai.app.webui.servlet;

import java.io.IOException;
import java.sql.SQLException;

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

import org.apache.log4j.Logger;
import org.apache.commons.lang.StringUtils;
import org.dspace.app.webui.util.JSPManager;
import org.dspace.authorize.AuthorizeException;
import org.dspace.core.Context;
import javax.servlet.http.HttpSession;

public class PDLogoutServlet extends org.dspace.app.webui.servlet.DSpaceServlet
{
    private static Logger log = Logger.getLogger(PDLogoutServlet.class);

    protected void doDSGet(Context context, HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException,
            SQLException, AuthorizeException
    {
    		HttpSession session = request.getSession(true);
  			session.setAttribute("usuario_id", "");
  			session.setAttribute("usuario", "");
  			session.setAttribute("usuario_nombre", "");
  			session.setAttribute("usuario_tipo", "");
  			session.setAttribute("libros_streaming", "");
				session.setAttribute("isbn_streaming", "");

    		response.sendRedirect(response.encodeRedirectURL(request.getContextPath() + "/"));
    }
    
		protected void doPost(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException
    {
        doGet(request, response);
    }

}
