Closed Zaniyar closed 3 years ago
Add withCredentials:true to client side for allowing exchange of sessions between different ports.
// client-side
const io = require("socket.io-client");
const socket = io("https://api.example.com", {
withCredentials: true,
extraHeaders: {
"my-custom-header": "abcd"
}
});
Earlier I set session.user on login and log it here:
And now I would like to see the same session.user in my socket, but I got only the session.cookie:
What am I missing here?
My backend and my client are on different servers running on https.