I have a staging and a production environment on my rails 3.1rc6 app which uses subdomains. I've bought and configured different domain names for these environments, because the default something-something.herokuapp.com doesn't play nicely with subdomains.
When I set session_store.rb to this for one environment, everything works fine:
AppName::Application.config.session_store :cookie_store, :key => '_sample_app_session' , :domain => '.mystagingdomain.co.uk'
But I can't seem to add in a conditional to allow for the environment-specific domain names.
I've tried
AppName::Application.config.session_store :cookie_store, :key => '_sample_app_session' , :domain => '.mystagingdomain.co.uk' if Rails.env.staging?
AppName::Application.config.session_store :cookie_store, :key => '_sample_app_session' , :domain => '.myproductiondomain.com' if Rails.env.production?
which doesn't work.