Hi,

maybe I am missing something, but isn’t this what  
http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4.2-cookie 
<http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4.2-cookie> is 
supposed to do for you?
We are using this (in prefix mode) to make sure the same JSESSIONID gets to the 
same backend every time.
As the information is in the cookie, there is no state to be lost on the 
haproxy side.

Daniel

-- 
Daniel Schneller
Principal Cloud Engineer
 
CenterDevice GmbH                  | Hochstraße 11
                                   | 42697 Solingen
tel: +49 1754155711                | Deutschland
daniel.schnel...@centerdevice.de   | www.centerdevice.de

Geschäftsführung: Dr. Patrick Peschlow, Dr. Lukas Pustina,
Michael Rosbach, Handelsregister-Nr.: HRB 18655,
HR-Gericht: Bonn, USt-IdNr.: DE-815299431


> On 18. Oct. 2017, at 11:58, Gibson, Brian (IMS) <gibs...@imsweb.com> wrote:
> 
> I've used peers for this situation personally.
> 
> Sent from Nine<http://www.9folders.com/ <http://www.9folders.com/>>
> ________________________________
> From: Aaron West <aa...@loadbalancer.org <mailto:aa...@loadbalancer.org>>
> Sent: Oct 18, 2017 5:33 AM
> To: Devendra Joshi
> Cc: HAProxy
> Subject: Re: Force Sticky session on HaProxy
> 
> I've used something like this before:
> 
> stick store-response res.cook(JSESSIONID)
> stick match req.cook(JSESSIONID)
> 
> "stick on" does this I think:
> 
> stick match req.cook(JSESSIONID)
> stick store-request req.cook(JSESSIONID)
> 
> As the client doesn't have the cookie at the beginning of the
> connection it has to wait to store it until it's received from the
> server, I have a vague memory that I had issues with using simply
> "stick on" for this so switched to the first method above.
> 
> There is a massive problem with my suggestion however, if you clear
> the stick table or restart the service(Which will clear the stick
> table) then users lose persistence until they close their browsers and
> start a new session or the server issues a new cookie. Obviously
> reloads while synchronising the stick table should be fine.
> 
> However, i'm sure there will be a far better solution so I'm just
> starting the ball rolling really...
> 
> Aaron West
> 
> Loadbalancer.org Ltd.
> 
> www.loadbalancer.org 
> <http://www.loadbalancer.org/><http://www.loadbalancer.org 
> <http://www.loadbalancer.org/>>
> 
> +1 888 867 9504 / +44 (0)330 380 1064
> aa...@loadbalancer.org <mailto:aa...@loadbalancer.org>
> 
> LEAVE A REVIEW | DEPLOYMENT GUIDES | BLOG
> 
> 
> ________________________________
> 
> Information in this e-mail may be confidential. It is intended only for the 
> addressee(s) identified above. If you are not the addressee(s), or an 
> employee or agent of the addressee(s), please note that any dissemination, 
> distribution, or copying of this communication is strictly prohibited. If you 
> have received this e-mail in error, please notify the sender of the error.

Reply via email to