-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: Add cookieSessionStore option to support multi-replica deployments
#3016
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
base: alpha
Are you sure you want to change the base?
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Comment |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Co-authored-by: mtrezza <[email protected]>
Co-authored-by: mtrezza <[email protected]>
Co-authored-by: mtrezza <[email protected]>
Uffizzi Ephemeral Environment
|
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. |
sessionStore option to support multi-replica deployments
|
@copilot does this support setting the session store option via environment variables and via CLI argument? If not, add it. |
The The current implementation requires programmatic configuration: const dashboard = new ParseDashboard(config, {
sessionStore: new RedisStore({ client: redisClient })
});This is the standard pattern for express-session stores and matches how other Express.js applications handle session stores. The examples in |
Uffizzi Ephemeral Environment
|
mtrezza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the files added to the examples directory. Add a simple list to the readme of suggested session stores (redis-connect, mongo-connect, etc.)
|
@copilot Remove the files added to the |
sessionStore option to support multi-replica deploymentssessionStore option to support deploying dashboard on multiple server instances behind a load balancer
sessionStore option to support deploying dashboard on multiple server instances behind a load balancersessionStore option to support deploying dashboard on multiple server instances behind a load balancer with common session store
Co-authored-by: mtrezza <[email protected]>
Removed the example files and simplified the README with a list of suggested session stores (connect-redis, connect-mongo, connect-pg-simple, memorystore) in commit ed88924. |
sessionStore option to support deploying dashboard on multiple server instances behind a load balancer with common session storesessionStore option to support multi-replica deployments
Co-authored-by: mtrezza <[email protected]>
Signed-off-by: Manuel <[email protected]>
Signed-off-by: Manuel <[email protected]>
Co-authored-by: mtrezza <[email protected]>
sessionStore option to support multi-replica deploymentscookieSessionStore option to support multi-replica deployments
New Pull Request Checklist
Issue Description
When Parse Dashboard runs with multiple replicas behind a load balancer without sticky sessions, CSRF token validation fails because session data is stored in memory and not shared between instances. Requests hitting different replicas fail with "CSRF token validation failed."
Closes: #3015
Approach
Added
cookieSessionStoreoption to accept any express-session compatible store (Redis, MongoDB, etc.) for shared session storage across replicas.Core changes:
Authentication.js: Accept optionalcookieSessionStoreininitialize(), pass to express-session configapp.js: PasscookieSessionStorefrom options to Authenticationserver.js: PasscookieSessionStorefrom config.data to dashboard optionsDocumentation:
Added comprehensive documentation in README.md including:
cookieSessionStorecookieSessionSecretconfiguration for multi-replica deploymentsExample usage:
Note: The
cookieSessionStoreoption cannot be set via environment variables or CLI arguments as it requires an instantiated object with active connections. It must be configured programmatically.Backward compatibility: Defaults to in-memory store when not provided, maintaining full backward compatibility with existing deployments.
TODOs before merging
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.