-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
session_id is ignored and a new one is generated instead #306
Comments
Hey @Leni-Vienne |
Thank you for helping me. I've made a repo where I can reproduce the issue with postman (a new cookie is always generated), And when commenting the line |
Not sure if related, but you do know app.post('/login', async (req, res) => { It will disregard whatever error or result that the promise resolves to. |
If you could make a PR that adds the reproduction as a failing test here then it would be easier to look into and fix: https://github.com/voxpelli/node-connect-pg-simple/blob/main/test/integration/express.spec.js I see that right now all the tests are using these settings: app.use(session({
store,
secret,
resave: false,
rolling: true,
saveUninitialized: true,
cookie: { maxAge },
...sessionOptions,
})); But none of the tests are sending in modified In your repository I'm seeing some different options, such as eg: resave: true,
saveUninitialized: false, If adding a test with eg. those options will fail similarly then it's no question that the error is in this module and we have to look at fixing it. Sorry for not having a better reply right now 🙏 |
Hi, I'm not sure myself what are the conditions required to reproduce the issue so I will struggle to write a test for it. |
Hello,
I'm facing an issue when inside a route where the req.session.id will always be a new one, thus retaining no information from the user cookie.
EDIT : test yourself with Docker : https://github.com/Leni-Vienne/nodePgConnect_issue
Here is some code of the backend :
req.session.save() does save successfully in the databse with 'id_user' and 'groupe' at the end of the sess JSON. I had a previous implementation with mySQL that worked flawlessly, it was almost a drop in replacement up to this point. Same with the default memory storage, it's able to retrieve informations about the user flawlessly.
I would love to get some help, thanks :)
The text was updated successfully, but these errors were encountered: