i am a beginner for node js. Have used a code from the internet to authenticate a user from Twitter and Facebook but it is giving me the following error 馃憤
_`
express-session deprecated undefined resave option; provide resave option app.js :74:9 express-session deprecated undefined saveUninitialized option; provide saveUnini tialized option app.js:74:9 C:\Users\Win 8.1\Downloads\twitter-login-node-master\node_modules\mysql\lib\prot ocol\Parser.js:82 throw err;^
code is attached anyone who like to help
here is the link of the given site
In your configuration to session, you need to specify the resave and the saveUninitialized options to the value you want to use. See https://github.com/expressjs/session#options for their values and meanings.
Example:
app.use(session({
secret: cookie_secret,
name: cookie_name,
store: sessionStore, // connect-mongo session store
proxy: true,
resave: true,
saveUninitialized: true
}));
Assuming you want to use true for those options.
@dougwilson sorry for my late to reply , i didn't found the above issue t first. And above issue has solved with your advise , but it creates another error saying that :
_express-session deprecated req.secret; provide secret option app.js:74:9
events.js:141
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED 127.0.0.1:3306
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1077:14)
--------------------_
THANKS IN ADVANCE
In your configuration to session, you need to specify the secret option to the value you want to use. See https://github.com/expressjs/session#options for their values and meanings.
Example:
app.use(session({
secret: 'keyboard cat',
name: cookie_name,
store: sessionStore, // connect-mongo session store
proxy: true,
resave: true,
saveUninitialized: true
}));
Assuming you want to use 'keyboard cat' as the secret.
Most helpful comment
In your configuration to session, you need to specify the
resaveand thesaveUninitializedoptions to the value you want to use. See https://github.com/expressjs/session#options for their values and meanings.Example:
Assuming you want to use
truefor those options.