From 99fa3ed1aa71a74af41a340670017f29000afb4e Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Mon, 10 May 2021 00:18:41 +0200 Subject: [PATCH] docs: add credentials option for cookie-based sticky sessions This is needed for cookie-based sticky sessions, for example with AWS load balancers and the AWSALBCORS cookie. Please note that the cookies must be created with `SameSite=None` and `Secure`. Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d38c618..2779f73 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,8 @@ const httpServer = createServer(); const io = new Server(httpServer, { cors: { - origin: ["https://admin.socket.io"] + origin: ["https://admin.socket.io"], + credentials: true // needed for cookie-based sticky sessions, else you can ignore this line } });