June 2014
Intermediate to advanced
696 pages
38h 52m
English
The cookie-parser middleware provided in Express makes handling cookies extremely simple. The cookie-parser middleware parses the cookies from a request and stores them in the req.cookies property as a JavaScript object. The cookie-parser middleware uses the following syntax:
express.cookie-parser([secret])
Note
The cookie-parser middleware will be renamed cookie when Connect 3.0 ships. You may need to change your code to support the new name if it doesn’t end up being backward compatible.
The optional secret string parameter prevents cookie tampering by internally signing the cookies using the secret string.
To set a cookie in a response, you can use the res.cookie() method shown ...
Read now
Unlock full access