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

Can't able to create Session with Express

Open thetechguy2016 opened this issue 7 years ago • 3 comments

CODE
/**
 * Module dependencies.
 */

var app = require('../app');
var debug = require('debug')('productiondisplaynodejs:server');
var http = require('http');
var socketSession = require("socket.io-session-middleware");

var MemoryStore = require('session-memory-store')(app);


// Create Session To use With Socket.io ***********
var session = {
    store: new MemoryStore(),
    secret: "secret",
    key: "mykey.sid",
    cookieParser: connect.cookieParser("secret")
};`

EXCEPTION var Store = express.Store || express.session.Store; ^

TypeError: Cannot read property 'Store' of undefined at module.exports (C:\Users\Administrator\IdeaProjects\ProductionDisplayNodejs\node_modules\session-memory-store\lib\memoryStore.js:19:47) at Object. (C:\Users\Administrator\IdeaProjects\ProductionDisplayNodejs\bin\www:12:50) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:389:7) at startup (bootstrap_node.js:149:9)

Process finished with exit code 1

thetechguy2016 avatar Jun 15 '17 12:06 thetechguy2016

Hey @thetechguy2016. We haven't used this module for quite some time now and it is out of date. You might be able to port it to the most recent express and socket.io versions.

Which versions are you using?

meaku avatar Jun 16 '17 08:06 meaku

Hi @meaku thanks for your reply, and apologize for the late reply, the socket.io version (2.0.2) , please let me know to create session with socket.io i tried many module's but none of them work properly . if you can help me ,it will be great full for me.

Thanks in Advance

thetechguy2016 avatar Jun 21 '17 04:06 thetechguy2016

hello,any of you found the way?

swanneptune avatar Feb 11 '20 10:02 swanneptune