Subdomain Session Not Working in Rails 2.3 and Rails 3 on Heroku with/without a Custom Domain? Subdomain Session Not Working in Rails 2.3 and Rails 3 on Heroku with/without a Custom Domain? heroku heroku

Subdomain Session Not Working in Rails 2.3 and Rails 3 on Heroku with/without a Custom Domain?


In your config/initializers/session_store.rb, tell rails to set the cookie across all domains:

Rails.application.config.session_store :cookie_store, :key => '_yourapp_session', :domain=>:all

Same as this SO question

If you are wanting to persist your session between "development-app.heroku.com" and "production-app.com" that cannot be done unless those are the same codebase. If they are the same codebase, then use a before_filter on your application controller to redirect to production-app.com


On development-app.heroku.com, I also have those custom subdomains, but since I don't have a custom domain, I just use the wildcard addon.

Is this addon still available for using custom subdomains like api.mydevdomain.herokuapp.com ?