On Sun, 20 Mar 2011 22:26:46 +0100, André Warnier wrote:
Felix Schumacher wrote:
...


The creation or retrieval of a session, as far as I understand it, is
totally under application control.
In other words, if your servlet (or JSP), when it is called, executes
a HttpServletRequest.getSession() call, then it will retrieve the
existing session (or create one if none exists yet); and if it does
not call getSession(), it will not.

If the browser sends a session-id, tomcat will touch the session and mark it as alive. My response above was made on the base of the Servlet Specification and the Javadoc of HttpRequest.getSession(). I am not versed enough in the specifics of the Tomcat code to contradict what you say above.
But I remain unconvinced.  It sounds illogical that the container
would go look for the session, before it is explicitly asked to do so.
You are right. I tested it with three simple files. First set an attribute in the session and redirects after 45 seconds to a second page. That page requests no session at all and redirects after 45 seconds to a third page. That page requests a session and tries to display the set attribute.

As you suspected, it fails to display the attribute (when session timeout is set to on minute :)

So the session is only refreshed (at least with my tested tomcat 6.0.32) when a session is requested by a servlet.

So I suspect the OP is requesting a session within his ajax-requests. If he is requesting a session, the thread I mentioned in my earlier post, could help him.

Thanks for correcting me
 Felix

So we need a real Tomcat expert here.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to