Skip to content
Myr

Merge pull request #707 from jakeg/patch-2

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Updated connect-redis markdown docs

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parents f4f79d2, add53d3 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:docs/guide.md+2 added-2 removed
613 unmodified lines
614 app.use(express.session({ secret: "keyboard cat" }));615616By default the _session_ middleware uses the memory store bundled with Connect, however many implementations exist. For example [connect-redis](http://github.com/visionmedia/connect-redis) supplies a [Redis](http://code.google.com/p/redis/) session store and can be used as shown below:617618 var RedisStore = require('connect-redis');618 var RedisStore = require('connect-redis')(express);619 app.use(express.cookieParser());620 app.use(express.session({ secret: "keyboard cat", store: new RedisStore }));621622Now the _req.session_ and _req.sessionStore_ properties will be accessible to all routes and subsequent middleware. Properties on _req.session_ are automatically saved on a response, so for example if we wish to shopping cart data:623624 var RedisStore = require('connect-redis');624 var RedisStore = require('connect-redis')(express);625 app.use(express.bodyParser());626 app.use(express.cookieParser());627 app.use(express.session({ secret: "keyboard cat", store: new RedisStore }));628
755 unmodified lines