Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 0ae7998975
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (15 sloc) 0.695 kB
section
h3(id='cookieSession') cookieSession()
p.
Provides cookie-based sessions, and populates <code>req.session</code>.
This middleware takes the following options:
ul
li <code>key</code> cookie name defaulting to <code>connect.sess</code>
li <code>secret</code> prevents cookie tampering
li <code>cookie</code> session cookie settings, defaulting to <code>{ path: '/', httpOnly: true, maxAge: null }</code>
li <code>proxy</code> trust the reverse proxy when setting secure cookies (via "x-forwarded-proto")
+js.
app.use(express.cookieSession());
p To clear a cookie simply assign the session to null before responding:
+js.
req.session = null
Jump to Line
Something went wrong with that request. Please try again.