Skip to content

Commit

Permalink
add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
albin committed Sep 2, 2015
1 parent 9eab7e2 commit 46d6fbc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var redis = require('redis');
var crypto = require('crypto');
var redis = require('redis');
var debug = require('debug')('index');

module.exports = nodeRedisSession;

Expand Down Expand Up @@ -54,7 +55,9 @@ function nodeRedisSession(params) {

//read session from redis when request comes.
sid = req.cookies[cookieName];
debug('cookieName: ', sid);
redisClient.get(sid, function(err, sessionStr) {
debug('sessionStr: ', sessionStr);
try {
if (!sessionStr)
req.session = {};
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
"description": "express middleware to save session with redis",
"main": "./lib/index",
"dependencies": {
"redis": "~0.11.0"
"redis": "~0.11.0",
"debug": "2.2.0"
},
"devDependencies": {
"mocha": "1.11.0"
"mocha": "1.11.0",
"debug": "2.2.0"
},
"keywords": [
"express",
Expand Down

0 comments on commit 46d6fbc

Please sign in to comment.