import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpSession;
public class SetGetMaxInterval extends HttpServlet
{
	public void doGet(HttpServletRequest req, HttpServletResponse res)
		throws IOException, ServletException
		{
			res.setContentType("text/html");
			PrintWriter pw = res.getWriter();
			HttpSession ssn = req.getSession();
			ssn.setMaxInactiveInterval(2*60);//sets the maximum time interval for 2 minutes
			int time = ssn.getMaxInactiveInterval();
			pw.println("<h1>The max interval of this session is set for "+time+" seconds</h1>");			
		}
}
