This enhancement, actually SVN Patched against 2.2.19, provides a worker status
flag to set a proxy worker as only accepting requests with sticky session
routes, e.g. only accept requests with a .route such as Cookie
JSESSIONID=xxx.tc2.
This allows for a graceful fade-out of servers when their sessions are removed;
they continue to receive requests for their sticky session routes but are
passed over for requests with no specified route, just as if they were
disabled. In other words, route-only workers are only enabled for sticky
session routes.
Intended use (Tomcat JSESSIONID noted here but could be PHPSESSIONID, Ruby
_session_id, or anything with cookie or request-parameter based session ids):
1. An Apache rev-proxy running for multiple Tomcats.
2. To fade-out a Tomcat for maintenance, set route-only enabled in
the
balancer-manager or reload the configuration with the worker status +R.
(This depends on Tomcat web-apps delete session cookies, see further below.)
3. Check on the balancer-manager or its Tomcat worker even a few minutes /
hours, and when it seems to have completed old sessions you can mark it fully
disabled.
4. Once done maintenance, you can then set route-only disabled (status -R) and
fully enable the worker again.
To delete a JSESSIONID Cookie from a Servlet, you need to specify the same
Domain and Path as the original Cookie and setMaxAge=0 as in the typical
example below but you should check on your own Domain and Path when a Cookie is
created, e.g. watch the Cookie headers in Firefox Firebug.
// To delete a Cookie setMaxAge(0) and also any original domain and path if
specified.
Cookie ck = new Cookie("JSESSIONID", null);
//ck.setDomain("");
ck.setPath(request.getContextPath());
ck.setMaxAge(0);
response.addCookie(ck);