question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

deprecation issue?

See original GitHub issue

I 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:closed
  • Created 9 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

37reactions
dougwilsoncommented, Jan 29, 2015

It’s very likely that if you console.dir(aSecret), it’s an empty string.

17reactions
johnantonicommented, Mar 13, 2018

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 ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found