Using a symfony generated session as an express session?

Inside PHP / Symfony I am using Redis Sessions to create a custom session.

Inside node.js I want to pull this session from the session store.

var redisSessionClient = redis.createClient({host:'redis://127.0.0.1/0'});
var sessionStore = new RedisStore({prefix: 'my_session', client: redisSessionClient});

app.use(session({
  resave: false,
  saveUninitialized: true,
  secret: secrets.sessionSecret,
  store: sessionStore
}));

      

Now in my route, I can check req.headers.cookie

and get the session id by looking at the cookie.

But I want to authenticate users on certain routes, so I need to look at req.session

to see if this matches, but the expression doesn't give me any information about the redis session, even if I went in express-session

beforeRedisStore

var session = require('express-session');
var RedisStore = connectRedis(session);

      

So ultimately, I want to check if the user using the node.js functions is authenticated on the main system built with Symfony.

EDIT

So, I can see that two cookies are generated: connect.sid

and onePHPSESSID

console.log(req.session)

returns connect.sid

enter image description here

+3


source to share





All Articles