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.

session: false doesn't work

See original GitHub issue

Session: false is not working. Your docs say it should be specified in options. But that’s not true. It doesn’t work that way.

passport.use(new LocalStrategy({
    usernameField: 'email',
    passwordField: 'passwd',
    session: false
  },
  function(username, password, done) {
    // ...
  }
));

Either change docs of modify the code. Because it has to be like this, not in initial config

passport.authenticate('local', {session:false})

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
Dealerpriestcommented, Jun 22, 2021

Same here. Looking in the source code I can’t see anywhere where the session-option is actually used 🤔

https://github.com/jaredhanson/passport-local/blob/4d9fbefeba48164c43d5bde4e48ff57c2c37d372/lib/strategy.js#L42-L56

0reactions
MarvinXucommented, Dec 1, 2022

Same here. Looking in the source code I can’t see anywhere where the session-option is actually used 🤔

https://github.com/jaredhanson/passport-local/blob/4d9fbefeba48164c43d5bde4e48ff57c2c37d372/lib/strategy.js#L42-L56

Looks like a documentation error.

session: false option only works in passport.authenticate('local', { session: false })

Read more comments on GitHub >

github_iconTop Results From Across the Web

Session variables not working php - Stack Overflow
Apparently, your session_save_path(), for me it was /var/lib/php5/, needs to have correct permissions (the user running php, eg www-data needs write access to ......
Read more >
session_start - Manual - PHP
session_start() now returns false and no longer initializes $_SESSION when it failed to start the session. Examples ¶. A basic session example ¶....
Read more >
Express session middleware
Forces a session that is “uninitialized” to be saved to the store. A session is uninitialized when it is new but not modified....
Read more >
How to use sessions - Django documentation
By default, SESSION_EXPIRE_AT_BROWSER_CLOSE is set to False , which means session cookies will be stored in users' browsers for as long as SESSION_COOKIE_AGE...
Read more >
Unable to use session state server because this version of ...
The session cache continues to work properly until the next application ... ="false"/> is set at the application level web.config, IIS will not...
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