Wednesday 6 April 2016

Express-Session. Sessions are never saved. Help!

Go easy on me friends. I'm a mobile developer venturing into the world of web dev. I'm learning about authentication. I want to skip passport until I understand what's going on better. So I'm using express-session with express-mysql-session as its store. At the start of my app I initiate my session as such: app.use(session({ genid: function(req) { return genuuid(function(err, uuid){ return uuid; });// use UUIDs for session IDs }, key: 'session_cookie_name', secret: 'session_cookie_secret', store: sessionStore, resave: true, saveUninitialized: true }));  Everytime my user loads the home page I check if a session.name exists, if it doesn't I set it. However each time the user refreshes the page, it looks like the session.name is null again. Why? Am I using express-session correctly?

Submitted April 07, 2016 at 04:54AM by createsomethingbig

No comments:

Post a Comment