# Haproxy Cookies Configuration for Multiple backend server

**URL:** <https://discourse.haproxy.org/t/haproxy-cookies-configuration-for-multiple-backend-server/9193>\
**Category:** Help!\
**Created:** [November 1, 2023, 11:47am UTC](https://discourse.haproxy.org/t/haproxy-cookies-configuration-for-multiple-backend-server/9193 "2023-11-01T11:47:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leo18](https://avatars.discourse-cdn.com/v4/letter/l/b77776/32.png) [@leo18](https://discourse.haproxy.org/u/leo18)\
**Post date:** [November 1, 2023, 11:47am UTC](https://discourse.haproxy.org/t/haproxy-cookies-configuration-for-multiple-backend-server/9193/1 "2023-11-01T11:47:04Z")

</div>

Hello,

Can anyone guide me to configure cookies in below scenario…!

My backend servers are configured with AWS Autoscaling Group, so I’m going to add and remove backend server to/from Haproxy configuration based on CPU metrics. So during this, I want to configure centralized cookies so that the end user can continue to access the site without leaving even if any server is removed from the backend.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![randomguy](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@randomguy](https://discourse.haproxy.org/u/randomguy)\
**Post date:** [November 1, 2023, 9:42pm UTC](https://discourse.haproxy.org/t/haproxy-cookies-configuration-for-multiple-backend-server/9193/2 "2023-11-01T21:42:35Z")

</div>

Can you help me understand your intended workflow? So let’s say a pool member is to be removed. Would you then edit the configuration and remove the pool member from the actual backend directive and reload the configuration?

The main idea that comes to mind for me would be to use “force persist” and just use a monitor to mark the backend server as down then wait for the sticky connections to bleed off.

[https://www.haproxy.com/documentation/haproxy-configuration-manual/latest/#4.2-force-persist](https://www.haproxy.com/documentation/haproxy-configuration-manual/latest/#4.2-force-persist)

Does that do what you’re looking for?
