Manually set DO-LB cookie to keep sending request to same server

I am working on an open source reactjs library which will send a request to my server, therefore its a cross origin request as it the request will be coming from any number of locations, browsers, domains to my servers domain.

The request is load balanced and I have a the sticky session set so that all subsequent request after my libraries initial initialisation request, the problem is requests from my browser, although in the chrome network tab sees the set-cookie:DO-LB=“dd86f65004c25f61”; Max-Age=1800; Path=/; HttpOnly; SameSite=Lax, because its from a different domain to the request the browser doesn’t store to resend it on further requests, and the cookie has the HttpOnly flag set so I can’t attempt to access it from the response in the reactjs library.

If in my initial initialisation request within my reactjs library I created a random string and set this as a cookie called DO-LB and sent this in the first request, would the load balancer reject the request or would it be able to use my string once it chooses a droplet to then use the same droplet for all further requests based on my cookie, instead of relying on the cookie response from the load balancer directly.

If it makes any difference, requests to my server, first go through Cloudflare DNS -> DO Load Balancer -> DO Droplet running Apache -> My .Net Core API Service

Any help here would be greatly appreciated.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer