You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ru...@apache.org on 2008/05/26 19:10:38 UTC

svn commit: r660232 - /synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/dispatch/HttpSessionDispatcher.java

Author: ruwan
Date: Mon May 26 10:10:36 2008
New Revision: 660232

URL: http://svn.apache.org/viewvc?rev=660232&view=rev
Log:
Fixing the issue with the transportsession, session affinity load balancing when operating on a non cluster environment (SYNAPSE-325)

Modified:
    synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/dispatch/HttpSessionDispatcher.java

Modified: synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/dispatch/HttpSessionDispatcher.java
URL: http://svn.apache.org/viewvc/synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/dispatch/HttpSessionDispatcher.java?rev=660232&r1=660231&r2=660232&view=diff
==============================================================================
--- synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/dispatch/HttpSessionDispatcher.java (original)
+++ synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/dispatch/HttpSessionDispatcher.java Mon May 26 10:10:36 2008
@@ -95,7 +95,16 @@
             Object cookie = headerMap.get(SET_COOKIE);
 
             if (cookie != null && cookie instanceof String) {
-                dispatcherContext.setEndpoint((String) cookie, endpoint);
+                
+                // extract the first name value pair of the Set-Cookie header, which is considered
+                // as the session id which will be sent back from the client with the Cookie header
+                // for example;
+                //      Set-Cookie: JSESSIONID=760764CB72E96A7221506823748CF2AE; Path=/
+                // will result in the session id "JSESSIONID=760764CB72E96A7221506823748CF2AE"
+                // and the client is expected to send the Cookie header as;
+                //      Cookie: JSESSIONID=760764CB72E96A7221506823748CF2AE
+                String sessionId = ((String) cookie).split(";")[0];
+                dispatcherContext.setEndpoint(sessionId, endpoint);
             }
         }
     }