Exhibt AÂ (the Apache 2.2 mod_proxy documentation):Â
stickysession | – | Balancer sticky session name. The value is usually set to something like JSESSIONID  or PHPSESSIONID , and it depends on the backend application server that support sessions. If the backend application server uses different name for cookies and url encoded id (like servlet containers) use | to to separate them. The first part is for the cookie the second for the path. |
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
Â
Exhibit BÂ (the Apache 2.2 mod_proxy code):
/* * If we found a value for sticksession, find the first '.' within. * Everything after '.' (if present) is our route. */ if ((*route) && ((*route = strchr(*route, '.')) != NULL )) (*route)++; if ((*route) && (**route)) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: BALANCER: Found route %s", *route); /* We have a route in path or in cookie * Find the worker that has this route defined. */ worker = find_route_worker(balancer, *route, r); if (worker && strcmp(*route, worker->s->route)) { /* * Notice that the route of the worker chosen is different from * the route supplied by the client. */ apr_table_setn(r->subprocess_env, "BALANCER_ROUTE_CHANGED", "1"); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: BALANCER: Route changed from %s to %s", *route, worker->s->route); } return worker; }
Translation: In Apache mod_proxy_balancer, sitcky sessions need to be in the format <cookie value>.<route> where route refers to the backend server.Â
Â
There are a couple of useful docs about this: Mark Round and the Jetty Docs. Normally I’d submit a patch to the Apache docs to clear this up, but unfortunately I haven’t been able to get failover between servers working correctly, so I’m not convinved I completely understand all the issues yet.
However, once you have got this working it turns out to be a case of RTFM.
Exhibit C:
route | – | Route of the worker when used inside load balancer. The route is a value appended to session id. |
Â
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
I’d argue that only makes any sense after you’ve got it working…