socket.io-session-middleware
socket.io-session-middleware copied to clipboard
Can't able to create Session with Express
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.
Process finished with exit code 1
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?
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
hello,any of you found the way?