I'm planning to use MemoryStore in production. My application doesn't care about lost session data after server restart & is small enough so there is no need for scaling. Taking that in count there is only one concern that I have left - warning that says: MemoryStore is not designed for a production environment, as it will leak memory, and will not scale past a single process.
Here is a suggestion of how it can be worked around: https://stackoverflow.com/a/10761522/4446128
Please note, at the time of writing, there is no answer to my question in linked question & I can't ask there because it requires 50 reputation which I don't have.
I set interval to log all sessions (.all
method on MemoryStore) & I see that sessions are being cleaned up after expiration date - so I don't think that leak is happening, but not 100% sure. Can someone confirm that it is not an issue anymore or tell me that I'm wrong & leak is still happening? If leak can still happen, please explain why.
Also not 100% sure that is relevant, but I'm using passport for authentication, so maybe it is cleaning up sessions?
Thank you.