title: Sails.js How to load session and create, check, destroy?
body: <p>In config session.js i have enabled redis
  before that i have installed these two things...</p>
  
  <p>npm install connect-redis</p>
  
  <p>npm install express</p>
  
  <pre><code>           adapter: 'redis',
            //
            // on localhost is expected.
            // Read more about options at: https://github.com/visionmedia/connect-redis
            //
             host: 'localhost',
             port: 6379,
             ttl: 3600,
             db: 0,
             pass: '',
             prefix: 'sess:'
  </code></pre>
  
  <p>In controller 2</p>
  
  <p>//assign the value in session and redirect to controller1
  req.session.error = "category Not found";</p>
  
  <p>//error
  TypeError: Cannot set property 'error' of undefined</p>
  
  <pre><code>            module.exports = {
  
                load_word: function(req, res){ 
                   var async = require('async');
                   var express = require('express');
                   var RedisStore = require('connect-redis')(express);
  
                   async.waterfall([
                          function(callback){
                              Category.findOne().where({keyword:req.param('keyword')}).done(function(err,category){
                                  if(category==undefined){ 
                                      req.session.error = "category Not found";
                                      res.redirect('home');
                                  }else{
                                      category_id = category.id;
                                  }
                                  /*Word.findOne().where({id:category_id}).done(function(err,word){ 
  
                                  });*/
                              });
                          },
  </code></pre>
  
  <p>Controller 1</p>
  
  <p>console.log(req.session.error);</p>
  
  <pre><code>           module.exports = {
  
            /**
             * Action blueprints:
             *    `/home/index`
             *    `/home`
             */
             index: function (req, res) {
              var async = require('async');
              var express = require('express');
              var RedisStore = require('connect-redis')(express);
              var data = new Object();
  
                  console.log(req.session.error);
  </code></pre>
  
  <p>How to solve this ?</p>