deprecation issue?
See original GitHub issueI don’t know why but I can’t shake this issue and I read through any other issue pertaining to this. ie: #100 but it hasn’t helped 😢
var express, expressSession, app, aSecret, port, server;
express = require('express');
expressSession = require('express-session');
app = module.exports = express();
aSecret = process.env.cookie;
app.use(expressSession({
secret: aSecret,
resave: false,
saveUninitialized: true,
cookie: {
path: '/',
httpOnly: true
}
}));
app.route('*').get(function(req, res){
return res.send('ok');
});
if (!module.parent && (process.env.HTTP != null || process.env.PORT != null)) {
port = (process.env.HTTP || process.env.PORT) || (yargs.argv.http || yargs.argv.port);
console.log('Server started on port ' + port + ' at ' + new Date(Date.now()));
server = app.listen(port);
}
what am I doing wrong? I thought this is how to pass secret to express-session?
I keep getting:
express-session deprecated req.secret; provide secret option app.js:6:9
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Deprecation Errors - Auth0
Deprecation Errors. When Auth0 features are deprecated, there may be errors or notices in the tenant logs that show up to indicate that...
Read more >What is deprecated in IT? - TechTarget
In information technology (IT), deprecation means that although something is available or allowed, it is not recommended or that -- in the case...
Read more >How and When to Deprecate APIs - Oracle Help Center
The ability to deprecate a class, method, or member field solves the problem. Java supports two mechanisms for deprecation: and an annotation, ...
Read more >docs/deprecation-issue.md at main - GitHub
The day after a GHES version's deprecation date, a banner on the docs will say: This version was deprecated on <date>. This is...
Read more >Deprecation - MoodleDocs
Deprecation, in its programming sense, is the process of taking older code and marking it as no longer being useful within the codebase,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s very likely that if you
console.dir(aSecret)
, it’s an empty string.Same here, thought it was deprecated but was actually an empty string.
Could always switch deprecation to:
express-session warning req.secret; please provide session secret
or
express-session warning req.secret; session secret undefined
or blank ?