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

express session is failing because session is undefined #980

Open
nikitakogan1994 opened this issue Apr 17, 2024 · 2 comments
Open

express session is failing because session is undefined #980

nikitakogan1994 opened this issue Apr 17, 2024 · 2 comments

Comments

@nikitakogan1994
Copy link

nikitakogan1994 commented Apr 17, 2024

Hi,

I am working with expressjs session as part of my application.
Sometimes, when a logout occurs, the code is trying to reload the session which is 'undefined' by then.

Is it possible to have a fix to check if the session is not 'undefined'? the failure is coming from the express-session code. (index.js line 387) It causes the crash of our application...

stack trace:
Exit status 1
var _reload = sess.reload
at /home/vcap/app/node_modules/express-session/index.js:387:11
^
at /home/vcap/app/node_modules/express-session/session/session.js:94:23
TypeError: Cannot read properties of undefined (reading 'reload')
at /home/vcap/app/node_modules/@sap/approuter/lib/backend-request/memstore.js:134:59
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
/home/vcap/app/node_modules/express-session/index.js:381
at wrapmethods (/home/vcap/app/node_modules/express-session/index.js:381:26)
at /home/vcap/app/node_modules/@sap/approuter/lib/backend-request/memstore.js:262:5
Node.js v18.17.1

@UlisesGascon
Copy link
Member

Hey @nikitakogan1994! Thanks for reporting this error... can you provide some code about the bug so we can reproduce it?

@nikitakogan1994
Copy link
Author

Hi, the problem is that the issue is happening only sometimes, with no clear pattern. (besides the fact that a logout happened).
Do you have any idea on how to reproduce? or just make sure that the code will not crash?

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

No branches or pull requests

2 participants