0

I have fully functional Rails 4 apps that run fine separately on the same MBPro, but if I have both running at the same time with a user logged into both, the last one where a user logs in, causes the other app's logged in user session to expire and I'm back at the login screen for that app. I am using Devise.

The rails start command I am using is:

rails s -p 3001 -b 0.0.0.0 rails s -p 3000 -b 0.0.0.0

kram1021
  • 23
  • 5
  • Take a look at a couple of the answers [here](https://stackoverflow.com/questions/34386624/rails-how-to-use-an-in-memory-sessionstore) , they may help you – Hayden Jun 13 '20 at 12:49
  • @Hayden this no longer works. I also noticed in Rails docs it is :mem_cache_store not :cache_store. I'm on Rails 4.2.10 for these apps. Thx Any ideas? – kram1021 Dec 13 '20 at 22:18

1 Answers1

0

Hayden's answer in the above comment didn't it. Notice the fix in the comment below.

AppName::Application.config.session_store :cache_store
kram1021
  • 23
  • 5
  • The real fix is I noticed I was using the same session cookie name for both apps, but overwriting each other. I resolved by adding an identifier in front the cookie name in /config/initializers/session_store.rb `Myapp::Application.config.session_store :cookie_store, { :key => '_ping_session',` – kram1021 Dec 29 '20 at 20:54