title: req.session is undefined in POST requests - SailsJS
body: <p>this is my current controller and the result of the logs is the problem.</p>
  
  <pre><code>log = console.log.bind(console)
  
  module.exports = 
  
      test: (req, res) -&gt;
          res.ok()
  
      current: (req, res) -&gt;  // GET app.com/accounts/current
          log 1, req.session  // 1, Object Session
  
      login: (req, res) -&gt; // POST app.com/accounts/login
          log 2, req.session // 2, undefined
  </code></pre>
  
  <p>Why is this happening?</p>
  
  <p>I'm using <code>io.socket.get &amp; io.socket.post</code> on the client to send these requests</p>
  
  <p>session config</p>
  
  <pre><code>module.exports.session = 
      secret: 'bb8775b377f1e8e198b864f8fdacbb9e'
  </code></pre>
  
  <p>I also noticed that response functions such as <code>res.forbidden &amp; res.ok</code> etc were also absent, maybe its more sensible to assume that for some reason the whole request is malformed. so if you're having any trouble with that, try my answer, it may help you</p>