开发者

Rails session cookie not getting set

开发者 https://www.devze.com 2022-12-25 19:12 出处:网络
I have a rails app that is a CMS that uses dynamic subdomains for each site.For some reason when I deployed to production the session cookie is not getting set.I\'m thinking this is leading to the \"I

I have a rails app that is a CMS that uses dynamic subdomains for each site. For some reason when I deployed to production the session cookie is not getting set. I'm thinking this is leading to the "Invalid Authenticity Token" errors that are being thrown everywhere.

I have my production.rb setup so that I can share sessions across subdomains. What could be going wrong that the cookie isn't being set at all?

#开发者_运维知识库production.rb
config.action_controller.session[:domain] = '.domain.com'


#environment.rb
config.action_controller.session = {
   :session_key => '_app_session',
   :secret      => '.... nums and chars .....'
 }


Try using the following in your production.rb:

config.action_controller.session = {:domain => '.domain.com'}

0

精彩评论

暂无评论...
验证码 换一张
取 消