Thomas Pedersen


50 Experience
0 Lessons Completed
0 Questions Solved


Has anyone successfully made multiple Rails 6 applications share the same session cookie? I have two applications: login and admin. Login authenticates the user and sets a session cookie after which it redirects the user to admin. Everything is running through Kong Gateway on port 80 like this.

+---> login:3001
+---> admin:3002

I have made sure credentials.yml.enc and the cookie_store key are the same in both repos. The cookie is also transmitted correctly through Kong, so the problem doesn't seem to be there. However, when the browser hits admin, the session is reset. What am I missing?

As a test I tried the same setup with ActiveRecord session store, which works flawlessly.


logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2023 GoRails, LLC. All rights reserved.