Express-session deprecated req.secret; provide secret option

What is your hint or solution suggestion?

you got error when secret option is null or undefined.

process.env.SESSION_SECRET = ‘secret’;

add this kind of code before app.use(session(…

Challenge: Set up Passport

Link to the challenge:

Welcome, spaepak.

Environment variables should not be set within the server script like that.

The instructions are:

Be sure to add ‘SESSION_SECRET’ to your .env file and give it a random value. This is used to compute the hash used to encrypt your cookie!

Hope this clarifies

thanks for the help.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.