socketio / socket.io

Realtime application framework (Node.JS server)
https://socket.io
MIT License
61.2k stars 10.11k forks source link

The socket.io does not take the necessary cookies when connecting #4835

Open makssein opened 1 year ago

makssein commented 1 year ago

On the beta.site.com domain I connect to my socket, the connection is successful, but on the server I see cookies only from the .site.com domain, although cookies from the beta.site.com domain should also have arrived, because this is the domain from which the connection is made. Why does this happen and how to fix it?

server:

 this.io = new Server(HTTPServer, {
            cors: {
                origin: process.env.SOCKET_ORIGIN,
                methods: ["GET", "POST"],
                credentials: true,
                transports: ['websocket', 'polling']
            },
            cookie: true,
            allowEIO3: true
        });

client:

socket = io(socketEndPoint, {
        withCredentials: true,
    });
darrachequesne commented 1 year ago

Hi! Did you find a solution?