Not able to send httpOnly cookies using socket-io.client

Viewed 16

I have a cookie-based authentication setup in my web app. For authenticating my socket also, I want to use the same cookie in my backend.

I am unable to send cookies for "websocket" or "polling" even when I have set withCredentials: true in my React App.

For WebSocket:

const socket = io('SOCKET_URL', {
    transports: ['websocket', 'polling'],
    withCredentials: true,
});

For polling:

const socket = io('SOCKET_URL', {
    transports: ['polling'],
    withCredentials: true,
});

My network tab: enter image description here

0 Answers
Related