express-socket.io-session icon indicating copy to clipboard operation
express-socket.io-session copied to clipboard

With express-socket.io-session module stopped to receive io connections

Open akontsevich opened this issue 6 years ago • 3 comments

After adding this code to Express app initialization

io.use(sharedsession(session, {
    autoSave:true
})); 

io.on('connection', function(socket) { ... } stopped to receive connections at all. Forced to use this solution: https://stackoverflow.com/a/25618636/630169 for now.

akontsevich avatar Nov 22 '18 17:11 akontsevich

I have exactly the same problem ... and we are 2 years later .. Thank you very much for the workaround !

AlexPiro avatar Nov 05 '20 18:11 AlexPiro

@akontsevich I have a question.

When you are using express-session with socket.io.

  1. are the session.id of the user be the same everytime it reconnects (e.g. reload the browser)?
  2. is the socket.session.id suppose to be the same as express req.session.id?

I'm asking because my ID is not persistent with all the solutions on stackoverflow ive seen (including the one you mentioned).

daveteu avatar Nov 11 '21 05:11 daveteu

@daveteu it was a long time ago, I do not know for now.

akontsevich avatar Nov 11 '21 12:11 akontsevich