Rails: how can I share permanent cookies across multiple subdomains?

后端 未结 1 1122
情歌与酒
情歌与酒 2021-01-02 23:43

My app\'s register and login processes take place on a secure subdomain. For this reason, I have modified config/initializers/session_store.rb to look like

相关标签:
1条回答
  • 2021-01-03 00:14

    You need to specify the domain using a more verbose cookie setting method:

    cookies[:some_cookie] = {
      :value => "whatever",
      :domain => ".app_name.com",
      :expires => 1.year.from_now.utc
    }
    

    I haven't found a configuration setting to do this globally yet.

    0 讨论(0)
提交回复
热议问题