Skip to content

Horizontally scale an app that uses sessions? #2140

Discussion options

You must be logged in to vote

You do not have to do anything on the backend in terms of shared anything to have sessions work across instances / nodes. As you mention the cookies are stateless and signed in such a way that any instance that shares secret will regard the cookie as valid. There is no functional difference between having multiple instances running on the same node or instances of the app spread across nodes / datacenters. A very common setup is having an ingress (eg. Nginx) and dispatching requests to an arbitrary number of nodes that all share the session secret. This works great. At $work we've had zero issues with session handling for the past 12+ years that we have been using Mojolicious. One very ni…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by please-fill-out-this-field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants