I am using IBM HTTP Server (Which use internally Apache Http Server 2.4.) http://docs.motechproject.org/en/latest/deployment/sticky_session_apache.html#:~:text=Sticky%20Session%20is%20a%20method,get%20lost%20across%20application%20instances.
After taking the reference from above selected second approach for doing the sticky session. But found it is not working. Call goes to first server then second.
Below is my configuration.
<VirtualHost *:443>
ServerName localhost
ProxyPreserveHost On
SSLEnable
SSLProxyEngine on
ProxyRequests Off
SSLTrace
KeyFile "C:/Program Files/IBM/HTTPServer/key.kdb"
SSLProxyCheckPeerCN off
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; Max-Age=60 path=/TestApp" env=BALANCER_ROUTE_CHANGED
<Proxy balancer://MyBalacer>
BalancerMember "https://10.54.21.35:4001" route=dev_1
BalancerMember "https://10.54.21.35:4011" route=dev_2
ProxySet lbmethod=bytraffic
ProxySet stickysession=ROUTEID
</Proxy>
<Location /TestApp>
ProxyPass balancer://MyBalacer/TestAPI
ProxyPassReverse balancer://MyBalacer/TestAPI
ProxyPassReverseCookiePath /TestAPI /TestApp
</Location>
</VirtualHost>
Please help me what i am doing the wrong here?
Update:
There is issue in my Cookie creation
Before:
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; Max-Age=60 path=/TestApp" env=BALANCER_ROUTE_CHANGED
After:
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; SameSite=None; path=/TestApp" env=BALANCER_ROUTE_CHANGED