title: TypeError: Cannot read property 'cookie' of undefined
body: <p>When calling my <code>User.create</code> method in my Sails.js app,  I get the following error:</p>
  
  <p>/Users/user/code/bt/tgein/node_modules/mongodb-core/lib/topologies/server.js:779
        catch(err) { process.nextTick(function() { throw err}); }</p>
  
  <p>Here is my User controller in its entirety. </p>
  
  <pre><code>User.create(req.params.all(), function userCreated(err, user) {
          // var userid = user.id;
          // console.log(userid);
  
          if(err) {
              console.log(err);
  
              req.session.flash = {
                  err: err.ValidationError
              }
  
              return res.redirect('/user/loginDetails');
          }
          var oldDateObj = new Date();
          var newDateObj = new Date(oldDateObj.getTime() + 60000);
          req.session.cookie.expires = newDateObj;
          req.session.authenticated = true;
          console.log(req.session);
          // res.redirect('/user/profileSelection/?id=' + user.id);
  
          // Saves user data into session variable
          req.session.user = user;
  
  
  
          res.redirect('/user/profileSelection/');
      });
  </code></pre>
  
  <p>apparently the session value is undefined for the request. This seems symptomatic of something basic that isn't happening, but I don't know what that is. </p>