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

Use MongoDB session store instead of the default Express store #46

Merged
merged 5 commits into from
May 17, 2022

Conversation

nok-ko
Copy link
Collaborator

@nok-ko nok-ko commented May 16, 2022

Switches over to connect-mongodb-session for storing sessions. Also adds in code for grabbing the session secret from .secrets/session.json.

Advantages:

  • Won't leak memory.
  • Uses existing database installation, should work as long as we have one.
  • Can use existing tools (e.g: MongoDB Compass, mongosh) to inspect sessions, should we need to.
  • Sessions will persist even if the server crashes.

Disadvantages:

  • One more thing that can fail.
  • Extra dependency on connect-mongodb-session.
  • Sessions will persist even if the server crashes – debugging may be more difficult.

This PR will close #18 and #30 if it gets merged.

@nok-ko
Copy link
Collaborator Author

nok-ko commented May 16, 2022

@nok-ko nok-ko force-pushed the Katy_Use_MongoDB_Session_Store branch from d6e0563 to 493df0e Compare May 16, 2022 21:34
@AlexLLKong AlexLLKong self-requested a review May 17, 2022 16:01
@nok-ko nok-ko merged commit 34a7a9f into dev May 17, 2022
nok-ko added a commit that referenced this pull request May 20, 2022
Use MongoDB session store instead of the default Express store
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

Successfully merging this pull request may close these issues.

Add express-session secret to the .secrets directory Use a better express-session store.
2 participants