We are encountering issues with our Socket.io implementation in a multi-instance infrastructure. According to the Socket.io documentation, stickiness is necessary for polling to function correctly. However in our auditing of the phase-out of third-party cookies, we have found that stickiness is not working on our platform, which operates in an embedded context. Specifically, the browser will not allow the cookie to travel, resulting in 400 errors for our polling APIs.
Our platform relies on AWS for load balancing, and we have noticed that AWS uses cookies to manage stickiness. However, because these cookies lack the partitioned attribute, they are not passed correctly in our embedded environment. This breaks the Socket.io polling mechanism.
What did you try?
We tried using AWS Application Load Balancer (ALB) with application-based stickiness, as per their documentation. However, the generated cookies do not include the necessary partitioned attribute, which is essential for our use case.
What were you expecting?
We expected the cookies used for stickiness to include the partitioned attribute so that they would be correctly passed in our embedded environment. This would ensure consistent stickiness for our Socket.io polling, allowing sessions to remain intact across multiple instances.
Additional Context:
-
We have a multi-instance infrastructure using Socket.io for real-time communication.
-
The phase-out of third-party cookies by browsers has impacted our ability to maintain stickiness.
-
AWS does not currently provide a way to set the partitioned attribute on these cookies.
Question:
Can anyone provide guidance on how to handle this situation or suggest alternative approaches?
Thanks in advance for your help!
1