NodeJS: "ENOENT" warning messages with sessions NodeJS: "ENOENT" warning messages with sessions express express

NodeJS: "ENOENT" warning messages with sessions


So I literally just ran into the same messages when I was trying my first NodeJS/Express Sample Project out.

I managed to determine that at least in my sample project that the Session is Declared Destroyed but the Cookie never cleared, so the next page that loaded used the old cookie to try and access the expired session (already deleted) causing the messages to get logged.

This might not be the same issue for you, but figured it was worth sharing... The lazy alternative is to replace the logFn option with an empty function:

new filestore({logFn: function(){}})


In my case that has not been as main problem, because session-file-store is a part of express-session and when express-session can't find session file, he just create new file.

And then you can just hide errors log as suggested earlier

new filestore({logFn: function(){}})


I was able to solve the same problem by chmod +x sessions