Stackato 2.10.X sticky sessions/JSESSIONID don't work with router2g

Posted by lorned on 2013-06-13 10:56
Question: 

In previous versions of stackato (2.6.7 and earlier) I was able to use sticky sessions/JSESSIONID to pass session data to my applications. This doesn't seem to be working in 2.10.4.

Answer: 

We changed router components in 2.8.2, which enabled the use of more than one router in a cluster. One of the side-effects of this change was a loss of the ability to manage sticky sessions. While it is still advisable to use database services to manage session data, we have created a patch to enable the use of sticky sessions with router2g. You can download the patch from https://get.stackato.com/patch/2.10/stackato-2.10.4-router-sticky-sessio.... This patch will need to be applied to any node in the cluster running the router role. After you copy the patch to each node you can install it via 'sh stackato-2.10.4-router-sticky-sessions.sh'. After installing the patch you will need to execute 'kato config set router2g session_affinity true' on one of the nodes in your cluster and restart the router role, via 'kato restart router', on all of the nodes running the role.

JSESSIONID note: If you would like to use JSESSIONID cookies you will need to modify /s/vcap/stackato-router/config/local.json with the following:

The sessionAffinityCookieRegExp line (line 18) should read:
"sessionAffinityCookieRegExp": "SESSIONID|PHPSESSID|JSESSIONID"

PLEASE NOTE: This patch touches the same file as http://community.activestate.com/node/9901. You should make sure you install that patch before you install this one.

This patch is also available for 2.10.6 users via kato patch, and can be installed with 'kato patch install'.