June 2014
Intermediate to advanced
696 pages
38h 52m
English
Another very common use of Express middleware is to provide session support for applications. For complex session management, you might want to implement it yourself, but for basic session support, the cookie-session middleware works relatively well.
The cookie-session middleware utilizes the cookie-parser middleware underneath, so you need to add cookie-parser prior to adding cookie-session. The following shows the syntax for adding the cookie-session middleware:
res.cookie([options])
The options parameter allows you to set the following properties for the cookie:
key: The name of the cookie that identifies the session. ...
Read now
Unlock full access