Search code examples
ruby-on-railssessioninitializer

session_store initializer working in production, but not development


I have a site with multiple subdomains, and have added :domain => :all to my session store as follows, so that my logins persist across all subdomains.

`MyApp::Application.config.session_store :cookie_store, key: '_MyApp_session', :domain => :all`

Although this seems to be working in production, I can't get my sessions to work across domains when in development. What could be causing this, and what can I add/delete from my config or environment files to make my development sessions match my production sessions?

Please let me know if there are specific lines of code that I need to check, and I will do so (or paste them in here). Thanks much for the feedback!


Solution

  • I am using the solution from @dimuch's link, and am setting the domain to :all during production and setting it to my development url of 'lvh.me' during development.