Configure session_store.rb to handle staging and production?

后端 未结 2 1893
夕颜
夕颜 2021-02-08 08:07

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 th

2条回答
  •  粉色の甜心
    2021-02-08 08:40

    The following settings has been working fine for me:

    config/environments/staging.rb

    AppName::Application.config.session_store :cookie_store, :key => '_sample_app_session' , :domain => '.mystagingdomain.co.uk'
    

    config/environments/production.rb

    AppName::Application.config.session_store :cookie_store, :key => '_sample_app_session' , :domain => '.myproductiondomain.com'
    

提交回复
热议问题