Here's my problem. It's absurdly simple, but I'm missing the obvious answer.
I have a web application that lets Joe User walk up and take surveys without any authentication. It also allows Jane Counselor to log in and view survey data. I want survey sessions and logged-in sessions to timeout after periods of inactivity.
But the "Start survey: please enter your age..." page and the "Login: please enter your username and password..." page to never time out. Currently, if either page sits open for longer than the timeout period, entering the data and clicking submit generates a 408 Session timeout error.
From reading bits of the 2.4
Servlet specification, this Session timeout is expected behavior. Is there some simple solution to this that I have missed? I see three solutions, but I am wary of all of them.
1. I can refresh the first question page and login page at time intervals less than the session timeout. This is the current solution, and it is inadequate. As a minor point, it adds a lot of needless traffic to the web server when kiosks with the software are unused for days. As a major point, if network connectivity is lost for some time period overnight, the periodic refresh leaves the browser open to a '404' error.
2. I'm using
Tomcat 5.0.28. God bless open source, I can modify
src\jakarta-tomcat-catalina\catalina\src\share\org\
apache\catalina\authenticator\FormAuthenticator.java
to create a new session on the spot when it gets a username and password but no previous session. But I'm assuming the Servlet specification was written the way it is written for a reason, even if that reason is not easily apparent to me.
3. I can disable global session timeouts for the entire context, and separately (and painfully) write a separate session timeout mechanism that is checked and updated manually by every Action-Mapping class in my web application except for the single two Action-Mappings affecting the first survey question page and the login page. This will work, but it's a hideously ugly workaround.
I'm hoping I've just missed something painfully simple. Any ideas?