# 2 Ways to Enable Sticky Sessions in HAProxy (Guide)

Link: [https://www.haproxy.com/blog/enable-sticky-sessions-in-haproxy](https://www.haproxy.com/blog/enable-sticky-sessions-in-haproxy)

<div class="flex justify-start" id="bkmrk-hypertext-transfer-p" style="text-align: justify;"><main class="post-content anchorise shrink xl:w-[780px] xl:min-w-[780px] xl:pl-default xl:mx-0 mx-auto overflow-x-hidden">HyperText Transfer Protocol (HTTP), the protocol that defines the language browsers use to communicate with web servers, is stateless, meaning that after you make a web request and a server sends back a response, no memory of that interaction remains. Websites need other ways to remember previous user interactions to make anything more sophisticated than a static web page work.

These days, Javascript frameworks like Vue.js, React.js, and others let developers create single-page applications (SPAs) that provide statefulness to the otherwise stateless web. Because they’re implemented as Javascript applications running in the user’s browser, they can keep track of what the user has done and render the app in a way that accounts for that shared history. However, the user’s browser

</main></div>Nick creates technical content for HAProxy Technologies ranging from documentation and blog posts to Wikipedia articles, GitHub READMEs and Stack Overflow answers. With a background in web development and DevOps, he has fun digging into product features and discovering the optimal path for a new blog tutorial.

<div class="shrink xl:w-[780px] xl:min-w-[780px] lg:px-default xl:mx-0 mx-auto" id="bkmrk-twitter%C2%A0linkedin%C2%A0git" style="text-align: justify;"><div class="max-w-[720px] mx-auto"><div class="pb-8 my-8 border-t-2 border-b-2"><div class="space-y-8"><div class="flex flex-row flex-wrap md:flex-nowrap"><div class="md:pl-default"><div>  
</div>[Twitter](https://twitter.com/NickMRamirez " on Twitter") [LinkedIn](https://www.linkedin.com/in/nick-ramirez-1b44624 " on LinkedIn") [GitHub](https://github.com/NickMRamirez " on GitHub")</div></div></div></div><div class="my-default">  
</div></div></div>## Related Posts

<div class="shrink xl:w-[780px] xl:min-w-[780px] lg:px-default xl:mx-0 mx-auto" id="bkmrk-september-14th%2C-2021"><div class="max-w-[720px] mx-auto"><div class="my-default" style="text-align: justify;">  
</div><div class="grid gap-6 md:grid-cols-2" style="text-align: justify;" x-intersect:enter="showSidebars = false" x-intersect:leave="showSidebars = true"><article class="flex flex-col mb-10 md:mb-0"><div class="">[![How to Enable Health Checks in HAProxy (Guide)](https://cdn.haproxy.com/img/containers/partner_integrations/haproxy_basics_-_health_checks.png/1e65a99af8752c8b986df775b5cde780/haproxy_basics_-_health_checks.webp)](https://www.haproxy.com/blog/how-to-enable-health-checks-in-haproxy)</div><div class="pt-2 px-3 flex flex-col justify-between flex-1"><div><time class="mb-1 text-xs " datetime="2021-09-14">September 14th, 2021</time></div></div>#### [How to Enable Health Checks in HAProxy (Guide)](https://www.haproxy.com/blog/how-to-enable-health-checks-in-haproxy)

HAProxy provides three types of health checks: active health checks, passive health checks and agent health checks. In this blog, we will learn about each one.

</article><article class="flex flex-col mb-10 md:mb-0"><div class="">[![2 Ways to Implement a Circuit Breaker in HAProxy (Guide)](https://cdn.haproxy.com/img/containers/partner_integrations/circuit-breaking-in-haproxy.png/837b6517d3385d8494d9b04e5537c20f/circuit-breaking-in-haproxy.webp)](https://www.haproxy.com/blog/circuit-breaking-haproxy)</div><div class="pt-2 px-3 flex flex-col justify-between flex-1"><div><time class="mb-1 text-xs " datetime="2021-01-05">January 5th, 2021</time></div></div>#### [2 Ways to Implement a Circuit Breaker in HAProxy (Guide)](https://www.haproxy.com/blog/circuit-breaking-haproxy)

In this blog post, you'll learn how to implement a circuit breaker with HAProxy in a simple and more complex way, that allows greater customization.

</article><article class="flex flex-col mb-10 md:mb-0"><div class="">[![Load Balancing, Affinity, Persistence & Sticky Sessions](https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/0f70f491cf1d494c1a33904b1fc4ae2d/haproxy-blog.webp)](https://www.haproxy.com/blog/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know)</div><div class="pt-2 px-3 flex flex-col justify-between flex-1"><div><time class="mb-1 text-xs " datetime="2012-03-29">March 29th, 2012</time></div></div>#### [Load Balancing, Affinity, Persistence &amp; Sticky Sessions](https://www.haproxy.com/blog/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know)

This blog post shows why and how to use a load balancer, the differences between Affinity, Persistence, and Sticky Sessions, and how to enable them in HAProxy.

</article><article class="flex flex-col mb-10 md:mb-0"><div class="" style="text-align: justify;">[![Preserve Source IP Address Despite Reverse Proxies (Guide)](https://cdn.haproxy.com/img/containers/partner_integrations/haproxy-blog.png/0f70f491cf1d494c1a33904b1fc4ae2d/haproxy-blog.webp)](https://www.haproxy.com/blog/preserve-source-ip-address-despite-reverse-proxies)</div><div class="pt-2 px-3 flex flex-col justify-between flex-1" style="text-align: justify;"><div><time class="mb-1 text-xs " datetime="2012-06-05">June 5th, 2012</time></div></div>#### [Preserve Source IP Address Despite Reverse Proxies (Guide)](https://www.haproxy.com/blog/preserve-source-ip-address-despite-reverse-proxies)

In this blog post, we aim to demonstrate how to preserve source IP addresses when using the reverse-proxy mode in HAProxy.

</article></div></div></div>