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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

req.flash() returning different values on same scope #44

Open
muktaking opened this issue Jan 15, 2019 · 1 comment
Open

req.flash() returning different values on same scope #44

muktaking opened this issue Jan 15, 2019 · 1 comment

Comments

@muktaking
Copy link

muktaking commented Jan 15, 2019

I set a flash value as:
req.flash('error', 'Invalid email or password');

but when i accessing this in appropriate section with console.log, the results are different:

console.log(req.flash('error')); //output: ['Invalid email or password']
console.log(req.flash('error')); // output: []

what is reason? why it is returning different result?

@neirongkuifa
Copy link

You can only access your session flash k-v pair once. After the first access, it is destroyed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants