My cookie isn't getting sent down on initial connection #3883
Unanswered
Jake-Prentice
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I realise this has been asked a ton before, but I've read through all of them and I haven't found a solution yet. Im using session authorization (express-session) and with all my other requests I've checked and they all have the correct cookie in the headers (req.headers).
but when checking the headers of the socket io connection, there are no cookies in the header, so I'm not able to do the authorization. I don't really want to use JWTs because I believe I would have to store the data in localstorage which is kinda unsecure (I'm no expert), I could use refresh tokens as well, but I want to just use sessions for their simplicity. Here is the code:
and here is what the headers of the socket.handshake.headers looks like:
and some of the client code:
Beta Was this translation helpful? Give feedback.
All reactions