Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

express-session deprecated undefined resave option #438

Closed
janithapm opened this issue Mar 10, 2017 · 4 comments

Comments

@janithapm
Copy link

commented Mar 10, 2017

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.docx

code is attached anyone who like to help

here is the link of the given site

https://codeforgeek.com/2014/09/twitter-login-using-node/

@janithapm

This comment has been minimized.

Copy link
Author

commented Mar 10, 2017

#56

@dougwilson

This comment has been minimized.

Copy link
Member

commented Mar 11, 2017

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 dougwilson closed this Mar 11, 2017

@dougwilson dougwilson self-assigned this Mar 11, 2017

@dougwilson dougwilson added the question label Mar 11, 2017

@janithapm

This comment has been minimized.

Copy link
Author

commented Mar 11, 2017

@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

@dougwilson

This comment has been minimized.

Copy link
Member

commented Mar 11, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.