There are three different methods to ensuring sticky sessions, each with their various pros and cons. Here's a quick summary:
- cookie: This method uses a cookie on the first request to store the tracking information in order to ensure subsequent requests are routed to the same backend server. As it means modifying the headers, it may not be compatible with all systems.
- learn: This is a stateful method, which relies on existing data within existing response headers to determine a unique identifier in which to track the requests. For example, most web frameworks have their own session ID, which can be leveraged for tracking. This means that no data modification is required.
- route: Lastly, we can route the request based on variables ...