exports.isLoggedIn = function (req) {
  return req.session ? !!req.session.user : false;
};

exports.createSession = function(req, res, newUser) {
  return req.session.regenerate(function () {
    req.session.user = newUser;
  });
};

exports.checkUser = function(req, res, next) {
  if (!exports.isLoggedIn(req)){
    // Set property on body indicating whether user has no session
    res.status(401).send({noSession: "true"});
   } else {
     next();
   }
};
@@ -27,24 +27,84 @@
 ion (req) %7B%0A
+  if (req.session) %7Bconsole.log(%22SESSION: %22, req.session);%7D%0A
   return req
@@ -127,21 +127,16 @@
 .session
-.user
  : false

Fix session detection