tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Luehe <Jan.Lu...@Sun.COM>
Subject Re: change in session activity tracking between Tomcat 4.1/5.0 and Tomcat 5.5
Date Thu, 17 Aug 2006 03:06:01 GMT
Hi Dies,

Dies Koper wrote On 08/16/06 05:28,:

>I'm looking into an issue we ran into when upgrading from Tomcat 4.1 to
>Tomcat 5.5.
>The time returned by the HttpSession.getLastAccessTime method seems to
>have changed.
>We believe it should return the time of the previous request from the
>same client. It did in Tomcat 4.1. It did so no matter whether that
>client accessed a Servlet or an html file.
>However, in Tomcat 5.5 it only returns this time if the previous request
>went to a servlet, and that servlet called the getSession or
>request.encodeURL method. Otherwise it returns the time of the last
>request from that client that did call either of those methods.

I think this change was made to bring the impl in compliance with the

The javadocs of HttpSession.getLastAccessedTime() have this:

* Returns the last time the client sent a request associated with
* this session, as the number of milliseconds since midnight
* January 1, 1970 GMT, and marked by the time the container received the
* request.

Notice the "associated with this session".

Only if a request creates or resumes a session should the session's
be updated.


>I am a bit confused why. Did the Tomcat developers disagree with the
>Servlet spec or the interpretation of it at the time Tomcat 4.1 was
>released and is this now fixed? Or is it an accidental side-effect of
>another change?
>The reason I ask is because I need to solve this problem. Should I look
>for a work-around or try to write a patch?
>So far, I found that the change happened in Tomcat 5.0, with the
>following commit.
>Revision: 302627
>Author: remm
>Date: 3:21:36, 2004-01-23
>- Improvements to session activity tracking, handling the case where the
>  session is new, as well as cross context.
>- If this doesn't work, I give up ;)
>Modified :
>Modified :
>Modified :
>Modified :
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message