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
This commit is contained in:
Damien Arrachequesne 2021-05-10 00:18:41 +02:00
parent eab7bfab64
commit 99fa3ed1aa
No known key found for this signature in database
GPG Key ID: 544D14663E7F7CF0
1 changed files with 2 additions and 1 deletions

View File

@ -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
}
});