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,:

>Hello,
>
>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
servlet
spec.

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
lastAccessedTime
be updated.


Jan


>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
>Message:
>- 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 :
>/tomcat/container/catalina/trunk/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java
>Modified :
>/tomcat/container/catalina/trunk/catalina/src/share/org/apache/catalina/core/ApplicationHttpRequest.java
>Modified :
>/tomcat/container/catalina/trunk/catalina/src/share/org/apache/catalina/core/StandardHostValve.java
>Modified :
>/tomcat/container/catalina/trunk/catalina/src/share/org/apache/catalina/session/StandardSession.java
>
>Thanks,
>Dies
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: dev-help@tomcat.apache.org
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message