# Backend stickiness issue \[JSON payload srv param requests\]

**URL:** <https://discourse.haproxy.org/t/backend-stickiness-issue-json-payload-srv-param-requests/962>\
**Category:** Help!\
**Created:** [January 26, 2017, 9:38pm UTC](https://discourse.haproxy.org/t/backend-stickiness-issue-json-payload-srv-param-requests/962 "2017-01-26T21:38:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vineeth](https://avatars.discourse-cdn.com/v4/letter/v/ac8455/32.png) [@vineeth](https://discourse.haproxy.org/u/vineeth)\
**Post date:** [January 26, 2017, 9:38pm UTC](https://discourse.haproxy.org/t/backend-stickiness-issue-json-payload-srv-param-requests/962/1 "2017-01-26T21:38:40Z")

</div>

We have an haproxy setup with cookie url\_param cookie based backend stickiness. The main issue we are seeing is that our clients are passing the srv param as part of a JSON payload. clients are sending their srv param in the JSON payload and this is causing their request to fail due to requests are passing to different backends. Any help would be greatly appreciated. The backend setup can be find below.

# HA-Proxy version 1.5.4

```
                    balance url_param srv
                    option httpclose
                    option redispatch
                    option forwardfor
                    reqadd X-Forwarded-Proto:\ https
                    cookie pxy50 insert indirect nocache secure domain .example.com maxidle 10m
                    server example1 x.x.x.x:8443 check ssl verify none cookie pxy50srv001A
		server example1_8444 x.x.x.x:8444 check ssl verify none cookie pxy50srv001B
                    server example2 x.x.x.x:8443 check ssl verify none cookie pxy50srv002A
                    serverexample2_8444 x.x.x.x:8444 check ssl verify none cookie pxy50srv002B
                    server example4 x.x.x.x:8443 check ssl verify none cookie pxy50srv004A
                    server example4_8444 x.x.x.x:8444 check ssl verify none cookie pxy50srv004B
```

---

<div class="post-metadata">

**Author:** ![aidofitz](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@aidofitz](https://discourse.haproxy.org/u/aidofitz)\
**Post date:** [January 31, 2017, 6:37pm UTC](https://discourse.haproxy.org/t/backend-stickiness-issue-json-payload-srv-param-requests/962/2 "2017-01-31T18:37:03Z")

</div>

Hi,

I think you are mixing two different methods for implementing session sticky - balance with a URL param (nothing to do with cookies) and then separately, cookie load balancing with “pxy50” cookie. Which one do you want to use? If it’s url\_param then the clients need to change to pass the parameter in the right place. If cookie based, then actually the above config looks right to me - so if it is not working you need to do some tracing of requests to find out why.

hope that’s some help.

- Adrian

---

<div class="post-metadata">

**Author:** ![vineeth](https://avatars.discourse-cdn.com/v4/letter/v/ac8455/32.png) [@vineeth](https://discourse.haproxy.org/u/vineeth)\
**Post date:** [February 7, 2017, 7:08pm UTC](https://discourse.haproxy.org/t/backend-stickiness-issue-json-payload-srv-param-requests/962/3 "2017-02-07T19:08:04Z")

</div>

Hi Adrian, Thanks for the update. As you said it’s a mixed conf and cookie based loadbalancing is working well. For now we have sorted out the issue. thanks again.
