You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.
I have an issue, when I try to connect my websocket through passport.socket.io I keep getting a no session found error. However, when I look at the log, it seems that i'm receiving the session cookie properly and it is valid (the same session is used in express and it work there)
What am I missing here?
My server code:
constSESSION_SECRET="coolkidsrunlinux";constSESSION_ID_NAME="session_cookie";try{varsessionStore=newMongoDBStore({uri: "mongodb://localhost/connect_mongodb_session_test",collection: "mySessions"});}catch(error){console.error("Error setting up mongoDB session store");throwerror;}app.use(cookieparser());app.use(session({secret: SESSION_SECRET,name: SESSION_ID_NAME,key: SESSION_ID_NAME,store: sessionStore,proxy: true,resave: false,saveUninitialized: true}));io.use((socket,next)=>{console.log(JSON.stringify(socket.handshake));returnnext();});io.use(passportSocketIo.authorize({cookieParser: cookieparser,// the same middleware you registrer in expresskey: SESSION_ID_NAME,// the name of the cookie where express/connect stores its session_idsecret: SESSION_SECRET,// the session_secret to parse the cookiestore: sessionStore,// we NEED to use a sessionstore. no memorystore pleasesuccess: onAuthorizeSuccess,// *optional* callback on success - read more belowfail: onAuthorizeFail// *optional* callback on fail/error - read more below}));
Hi @theochampion you resolve this issue? I have the exact same error here. I notice that I don't have anything on the session collection so I suppose that is the problem of MongoStore and not an issue of passport.socketio but I don't know.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi there,
I have an issue, when I try to connect my websocket through passport.socket.io I keep getting a
no session found
error. However, when I look at the log, it seems that i'm receiving the session cookie properly and it is valid (the same session is used in express and it work there)What am I missing here?
My server code:
my client code (dart)
Upon connection, when I log the
socket.handshake
i get this which seems to indicate that the session is receivedThe text was updated successfully, but these errors were encountered: