What
Fix "Session ID unknown" errors in Socket.io deployments.
Why
HTTP long-polling requires sticky sessions. Without load balancer affinity, requests hit different servers causing session mismatch.
How
Disable HTTP long-polling, use WebSockets only:
// Client-side
const socket = io({
transports: ["websocket"],
});
WebSockets maintain persistent connection, eliminating the need for sticky sessions.