httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: Adding stickysession cookie on the proxy
Date Wed, 05 Mar 2008 22:26:36 GMT


On 03/05/2008 09:12 PM, Jani M. wrote:
> Hi,
> 
> I've been playing with the idea of adding support for the proxy module 
> to add stickysession cookies on behalf of the backend servers. I have 
> one case on my hands right now where this would be needed, and I can 
> think of this being of use for others too.
> 
> The way this would work is that if the proxy would see a response from a 
> backend to which no LB cookie was received either from the client or the 
> backend, a new cookie would be injected to the response. If the cookie 
> already exists, nothing would be done. The cookie when added would be 
> based on the balancer and member-name of the current worker

You can already do this with mod_headers. Just add

Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;" env=BALANCER_ROUTE_CHANGED

to the proxy block that defines your balancer, use

ProxySet  stickysession=MYCOOKIE

and define the routes of your BalancerMembers accordingly

No need for additional code IMHO.

Regards

RĂ¼diger


Mime
View raw message