WebSocket with Session
Unanswered
Cape lion posted this in #help-forum
Cape lionOP
I am building casino project using Next and Express.
For chat and game I used socket.io.
But when I try to send sessionID on socket connection it doesn't work.
It worked well on the local.
It doesn't work after I deployed.
Anyone could help me please?
For chat and game I used socket.io.
But when I try to send sessionID on socket connection it doesn't work.
It worked well on the local.
It doesn't work after I deployed.
Anyone could help me please?
34 Replies
Why don’t you use native fetch?
Anyways, we can’t help if there isn’t any code and/or errors. Can you please send them?
I would recommend using GitHub to share them
Cape lionOP
I can't share project on github.
@Cape lion I can't share project on github.
Masai Lion
?
@Masai Lion ?
Cape lionOP
it is client's project
@Cape lion it is client's project
Masai Lion
then we can’t help you if you can’t share the code lol
@Cape lion I can't share project on github.
just send the code snippet where you need help
Cape lionOP
this is front end part
import io from "socket.io-client";
const socket = io("https://my-backend-domain.com", {
withCredentials: true,
});
import io from "socket.io-client";
const socket = io("https://my-backend-domain.com", {
withCredentials: true,
});
and wdym by it doesn't work?
there are like million possibilities
share me that one possiblitly
Cape lionOP
I set withCredintials: true
but it doesn't take cookie.
tell me the story
tell me the expected outcome
and tell the current outcome
you're sharing bits and bits
Cape lionOP
help me please 🙏 😭
@averydelusionalperson wut?
Masai Lion
lol that’s why I was asking for a code dumbboy
@Cape lion help me please 🙏 😭
Masai Lion
if you just share 3 lines of code, there is no chance we can help you
Cape lionOP
what do you need exactly?
@Cape lion what do you need exactly?
Masai Lion
your code lol
I mean maybe the function(s) you are using websocket in
Idk bro
Cape lionOP
well, it dooesn't related to function
@Cape lion well, it dooesn't related to function
Masai Lion
man, then just share where the error is and don’t just send three lines
Cape lionOP
do you know how to include cookies on socekt connection?
@Cape lion do you know how to include cookies on socekt connection?
Masai Lion
I mean just make a request to socket
Capture the response
And make a cookie for it