title: HAProxy - Maintain session stickiness after failover
body: <p>I'm having a situation where I've to maintain session stickiness in case of a node's failure.
  The configuration is:</p>
  
  <ul>
  <li>three nodes (as1, as2, as3) running our enterprise application on JBoss 4.2.3 (homogeneous cluster)</li>
  <li>HAProxy doing roundrobin (one TCP server and one Tomcat) for each nodes</li>
  <li>replicated tomcat sessions (for SSO on failover)</li>
  <li>stick sessions enabled (appsession directive)</li>
  </ul>
  
  <p>My problem is when I put down one of the nodes (ie. as3) the session stickiness breaks immediately: the session fails over without reauthentication (Tomcat shared sessions), but from now on every request get served from different servers (as1 as2 as1 as2 as1 as2 ...).</p>
  
  <p>How can I ensure that the failed over request will stick to the first available server on failover?</p>