/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package demojsoncrud.servlets;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Percy Oliver Quispe Huarcaya
 */
public class AddSession extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String codigo = request.getParameter("codigoUsuario");
        String menu = request.getParameter("menu");
        HttpSession session = request.getSession();
        session.setAttribute("codigo", codigo);
        session.setAttribute("menu", menu);
        session.setMaxInactiveInterval(120*60); //Tiempo en segundos
        System.out.println("-----------------------------");
        System.out.println("codigo : : "+codigo);
        System.out.println("menu : : "+menu);
    }

    
}
