You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2013/04/30 17:15:53 UTC

svn commit: r1477683 - in /qpid/branches/0.22/qpid/java: ./ broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java

Author: orudyy
Date: Tue Apr 30 15:15:53 2013
New Revision: 1477683

URL: http://svn.apache.org/r1477683
Log:
QPID-4791: Change JSESSIONID cookie name to include the port number in order to avoid JSESSIONID cookie name collisions when running multiple we

merged from trunk r1477668


Modified:
    qpid/branches/0.22/qpid/java/   (props changed)
    qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java

Propchange: qpid/branches/0.22/qpid/java/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java:r1477668

Modified: qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java?rev=1477683&r1=1477682&r2=1477683&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java (original)
+++ qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java Tue Apr 30 15:15:53 2013
@@ -138,6 +138,8 @@ public class HttpManagement extends Abst
         put(PluginFactory.PLUGIN_TYPE, String.class);
     }});
 
+    private static final String JSESSIONID_COOKIE_PREFIX = "JSESSIONID_";
+
     private Server _server;
 
     public HttpManagement(UUID id, Broker broker, Map<String, Object> attributes)
@@ -218,6 +220,7 @@ public class HttpManagement extends Abst
         }
 
         Server server = new Server();
+        int lastPort = -1;
         for (Port port : ports)
         {
             if (State.QUIESCED.equals(port.getActualState()))
@@ -253,6 +256,7 @@ public class HttpManagement extends Abst
             {
                 throw new IllegalArgumentException("Unexpected protocol " + protocols);
             }
+            lastPort = port.getPort();
             connector.setPort(port.getPort());
             server.addConnector(connector);
         }
@@ -313,7 +317,7 @@ public class HttpManagement extends Abst
         root.addServlet(new ServletHolder(new HelperServlet()), "/rest/helper");
 
         final SessionManager sessionManager = root.getSessionHandler().getSessionManager();
-
+        sessionManager.setSessionCookie(JSESSIONID_COOKIE_PREFIX + lastPort);
         sessionManager.setMaxInactiveInterval((Integer)getAttribute(TIME_OUT));
 
         return server;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org