Cloudflare dynamic sticky sessions

So I'm using a load balancer, which has server1 and server2. Now I want each user to have a sticky session, because of states on the server. If the user had a state on server1, and would request server2, the state wouldn't be found. So I used cookie and Client IP fallback, but what if the user logs in from a different device with a different ip, while the state is ongoing? Then we have an issue. So I would save the state in an external db accessable from both servers, with a value on which server the state is on, and if the user requests the wrong server, I return that they need to change the server in the api, and it would change to use that server. Is this possible? Can you tell users through an api which server to set their sticky session to? Any help is appreciated.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?