You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by cd...@apache.org on 2007/10/05 13:13:47 UTC

svn commit: r582210 - /portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java

Author: cdoremus
Date: Fri Oct  5 04:13:46 2007
New Revision: 582210

URL: http://svn.apache.org/viewvc?rev=582210&view=rev
Log:
Applied PLUTO-436 patch. Thank you Paul.

Modified:
    portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java

Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java?rev=582210&r1=582209&r2=582210&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java Fri Oct  5 04:13:46 2007
@@ -217,10 +217,10 @@
         if (httpSession != null) {
             // HttpSession is not null does NOT mean that it is valid.
             int maxInactiveInterval = httpSession.getMaxInactiveInterval();
-            if (maxInactiveInterval >= 0) {    // < 0 => Never expires.
+            long lastAccesstime = httpSession.getLastAccessedTime();//lastAccesstime checks added for PLUTO-436
+            if (maxInactiveInterval >= 0 && lastAccesstime > 0) {    // < 0 => Never expires.
                 long maxInactiveTime = httpSession.getMaxInactiveInterval() * 1000L;
-                long currentInactiveTime = System.currentTimeMillis()
-                    - httpSession.getLastAccessedTime();
+                long currentInactiveTime = System.currentTimeMillis() - lastAccesstime;
                 if (currentInactiveTime > maxInactiveTime) {
                     if (LOG.isDebugEnabled()) {
                         LOG.debug("The underlying HttpSession is expired and "
@@ -228,6 +228,10 @@
                     }
                     httpSession.invalidate();
                     httpSession = getHttpServletRequest().getSession(create);
+                    //Added for PLUTO-436
+                    // a cached portletSession is no longer useable.
+                    // a new one will be created below.
+                    portletSession = null;
                 }
             }
         }