Open ghost opened 9 years ago
Yes, frustratingly, express-session
has changed considerably since I finished the manuscript, including deprecated options that now generate warnings. However, the repository should still work since it makes version numbers explicit in package.json
. Also, those warning should not produce errors, so I suspect something else is wrong. I will look into this and get back to you.
I also have errors with this...
hi I have a problem I try ch 10 another error. It is parse error. Error: Parse error on line 67: ...pt>
I have been working in Chapter 9 for Cookies and Sessions. With my own web app that I have been building as I follow along with your book is not able to load my root page when I attempt your example. The console shows errors with express-sessions depreciated with options for resave, saveUninitialized, and req.secret (provide secret option). I tested your ch10 tag to see how to debug my mistake and found the same error.
I then went and looked up the express-sessions on github for more info. I found the following code with one option added:
This works: var session = require('express-session') app.use(session({secret: 'keyboard', resave: true}));
This produces errors: var session = require('express-session') app.use(session({secret: credentials.cookieSecret, resave: true}));
It is unclear how I can refactor your example to work, so the secret key will be hidden via module.export in the credentials.js file. Please let me know your advice for correcting this issue. Thanks.