You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2001/03/17 01:08:47 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/session StandardManager.java StandardSession.java

marcsaeg    01/03/16 16:08:46

  Modified:    src/share/org/apache/tomcat/session Tag: tomcat_32
                        StandardManager.java StandardSession.java
  Log:
  HttpSession.getLastAccessedTime() returns the time the session was accessed
  prior to the current request.  Therefore two access times are maintained
  within the session (lastAccessedTime and thisAccessedTime).
  
  Session expiration should be based on the most recent accessed time, not
  the value returned by getLastAccessedTime(), otherewise its possible to
  expire a session prematurely.
  
  This fix adds method to StandardSession to expose the value of
  thisAccessedTime and change session expiration checking to use this method.
  
  PR:  570
  Submitted by:	murthy@teamon.com
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.11.2.3  +5 -5      jakarta-tomcat/src/share/org/apache/tomcat/session/Attic/StandardManager.java
  
  Index: StandardManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/session/Attic/StandardManager.java,v
  retrieving revision 1.11.2.2
  retrieving revision 1.11.2.3
  diff -u -r1.11.2.2 -r1.11.2.3
  --- StandardManager.java	2000/12/22 17:38:15	1.11.2.2
  +++ StandardManager.java	2001/03/17 00:08:40	1.11.2.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/session/Attic/StandardManager.java,v 1.11.2.2 2000/12/22 17:38:15 marcsaeg Exp $
  - * $Revision: 1.11.2.2 $
  - * $Date: 2000/12/22 17:38:15 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/session/Attic/StandardManager.java,v 1.11.2.3 2001/03/17 00:08:40 marcsaeg Exp $
  + * $Revision: 1.11.2.3 $
  + * $Date: 2001/03/17 00:08:40 $
    *
    * ====================================================================
    *
  @@ -103,7 +103,7 @@
    * @author costin@eng.sun.com
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
    * @author Shai Fultheim [shai@brm.com]
  - * @version $Revision: 1.11.2.2 $ $Date: 2000/12/22 17:38:15 $
  + * @version $Revision: 1.11.2.3 $ $Date: 2001/03/17 00:08:40 $
    */
   public final class StandardManager implements Runnable  {
       // ----------------------------------------------------- Instance Variables
  @@ -478,7 +478,7 @@
   	    if (maxInactiveInterval < 0)
   		continue;
   	    int timeIdle = // Truncate, do not round up
  -		(int) ((timeNow - session.getLastAccessedTime()) / 1000L);
  +		(int) ((timeNow - session.getLatestAccessedTime()) / 1000L);
   	    if (timeIdle >= maxInactiveInterval)
   		session.expire();
   	}
  
  
  
  1.15.2.1  +12 -4     jakarta-tomcat/src/share/org/apache/tomcat/session/Attic/StandardSession.java
  
  Index: StandardSession.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/session/Attic/StandardSession.java,v
  retrieving revision 1.15
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- StandardSession.java	2000/06/18 22:21:49	1.15
  +++ StandardSession.java	2001/03/17 00:08:42	1.15.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/session/Attic/StandardSession.java,v 1.15 2000/06/18 22:21:49 jon Exp $
  - * $Revision: 1.15 $
  - * $Date: 2000/06/18 22:21:49 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/session/Attic/StandardSession.java,v 1.15.2.1 2001/03/17 00:08:42 marcsaeg Exp $
  + * $Revision: 1.15.2.1 $
  + * $Date: 2001/03/17 00:08:42 $
    *
    * ====================================================================
    *
  @@ -97,7 +97,7 @@
    *
    * @author Craig R. McClanahan
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
  - * @version $Revision: 1.15 $ $Date: 2000/06/18 22:21:49 $
  + * @version $Revision: 1.15.2.1 $ $Date: 2001/03/17 00:08:42 $
    */
   
   final class StandardSession
  @@ -269,6 +269,14 @@
   
       }
   
  +
  +    /**
  +     *
  +     */
  +    public long getLatestAccessedTime()
  +    {
  +        return this.thisAccessedTime;
  +    }
   
       /**
        * Return the Manager within which this Session is valid.