Sticky Sessions (Session Affinity)
Embed This Widget
Add the script tag and a data attribute to embed this widget.
Embed via iframe for maximum compatibility.
<iframe src="proxy.php?url=https%3A%2F%2Fstatuscodefyi.com%2Fiframe%2Fglossary%2Fsticky-sessions%2F" width="420" height="400" frameborder="0" style="border:0;border-radius:10px;max-width:100%" loading="lazy"></iframe>
Paste this URL in WordPress, Medium, or any oEmbed-compatible platform.
https://statuscodefyi.com/glossary/sticky-sessions/
Add a dynamic SVG badge to your README or docs.
[](https://statuscodefyi.com/glossary/sticky-sessions/)
Use the native HTML custom element.
A load balancing configuration that ensures all requests from the same client are consistently routed to the same backend server for the duration of a session. Sticky sessions are implemented via cookie insertion (the LB sets a cookie containing the backend server ID) or source IP hashing. They are necessary for stateful applications that store session state in server memory rather than a shared store such as Redis. The trade-off is reduced load distribution effectiveness: if one backend receives many long-lived sticky sessions, it can become a hotspot while others remain underutilised.