On 09/14/2006 05:28 PM, Jim Jagielski wrote:
> There is a lot of confusion where the users think that
> simply adding the stickysession param to the http worker
> attribute *adds* the required sticky session info (cookie).
> 
> I'm looking into adding functionality that actually
> does that and therefore avoiding this large and common
> misconception.
> 
> Comments?

I guess this is nearly possible today, although it is not that easy to 
configure:

Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;"
ProxyPass /test balancer://mycluster/test stickysession=MYCOOKIE nofailover=On

(which sets the cookie over and over again of course)

See also
http://mail-archives.apache.org/mod_mbox/httpd-dev/200606.mbox/[EMAIL PROTECTED]

What is currently missing from my perspective is to set an environment variable 
inside of
mod_proxy_balancer (e.g. BALANCER_ROUTE_CHANGED) if the supplied route and the 
chosen route is different.

So we could do something like the following

SetEnvIf Cookie  MYCOOKIE HAVE_ROUTE
Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;" 
env=!HAVE_ROUTE
Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;" 
env=BALANCER_ROUTE_CHANGED
ProxyPass /test balancer://mycluster/test stickysession=MYCOOKIE nofailover=On

or even

Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;" 
env=BALANCER_ROUTE_CHANGED
ProxyPass /test balancer://mycluster/test stickysession=MYCOOKIE nofailover=On

if BALANCER_ROUTE_CHANGED is also set if balancer->sticky is set and no route 
was found in the request.

In general I would like to avoid that we reinvent the wheel for this, as nearly 
all ingredients
seem to be available right now. See also my comments in

http://mail-archives.apache.org/mod_mbox/httpd-dev/200606.mbox/[EMAIL PROTECTED]


Regards

Rüdiger

Reply via email to