Can't get Express session ID from cookies w/ Socket.IO

后端 未结 1 1793
执念已碎
执念已碎 2021-02-19 10:07

I have a typical web application in Node that is utilizing the Express framework and the session middleware. I am also using Socket.io for certain dynamic parts of my applicatio

相关标签:
1条回答
  • 2021-02-19 10:29

    I never would have thought of this until told to look at the initialization on the client side. I changed the address from localhost to the explicit IP (127.0.0.1) and the cookies are now being sent with the header in Socket.IO. I'm not sure if this is obvious or not, as I assumed localhost was being mapped to 127.0.0.1 anyway.

    0 讨论(0)
提交回复
热议问题