portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1171699 - /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java
Date Fri, 16 Sep 2011 18:11:39 GMT
Author: ate
Date: Fri Sep 16 18:11:39 2011
New Revision: 1171699

URL: http://svn.apache.org/viewvc?rev=1171699&view=rev
Log:
JS2-1257: fix for running on Tomcat 7 which by default changes sessionId on login, but now
doesn't provide any kind of notification to detect this (like Tomcat 6 does).
 

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java?rev=1171699&r1=1171698&r2=1171699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/session/PortalSessionsManagerImpl.java
Fri Sep 16 18:11:39 2011
@@ -203,12 +203,12 @@ public class PortalSessionsManagerImpl i
             PortalSessionRegistry psr = portalSessionsRegistry.get(portalSession.getId());
             if (psr == null)
             {
-                // yet unexplained condition: the HttpSessionListener on the portal application
*should* have registered the session!!!
-                // Alas, it has been reported to happen...
-                // Now trying to do some recovering here
+                // On Tomcat 7, by default after authentication it will change the session.getId()
without notifying anything...
+                // On Tomcat 6 this at least still lead to a SessionCreated event, but for
Tomcat 7 we only can check for a similar condition
+                // and then just emulate as if it happened. 
                 PortalSessionMonitor psm = (PortalSessionMonitor)portalSession.getAttribute(PortalSessionMonitor.SESSION_KEY);
                 // the psm better be null here, otherwise something really is corrupt or
not playing by the listeners contracts
-                if ( psm == null )
+                if ( psm == null || portalSessionsRegistry.containsKey(psm.getSessionId())
)
                 {
                     portalSessionCreated(portalSession);
                 }



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


Mime
View raw message