Evan Lee
Evan Lee

Reputation: 758

req.session is undefined?

I am trying to learn node.js recently. And sails.js looks promising.

I just setup sails project, everything works ok. except that req.session is undefined.

Here is my config:

module.exports.session = {
  secret: '0f18410746715474fa79f357f6dedd75',
  adapter: 'redis'
};

when I try to use,

req.session.user = 'admin'

I find that req.session is not defined.

Upvotes: 4

Views: 1331

Answers (1)

Evan Lee
Evan Lee

Reputation: 758

I just solve the problem. I didn't install redis. Just install redis will work.

sudo apt-get install redis

Upvotes: 3

Related Questions