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 16:41:57 UTC

svn commit: r1477668 - /qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java

Author: orudyy
Date: Tue Apr 30 14:41:57 2013
New Revision: 1477668

URL: http://svn.apache.org/r1477668
Log:
QPID-4791: Change JSESSIONID cookie name to include the port number in order to avoid JSESSIONID cookie name collisions when running multiple web management consoles in the same broswer comminication with the brokers started on different ports of the same host

Modified:
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java?rev=1477668&r1=1477667&r2=1477668&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java Tue Apr 30 14:41:57 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