Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
domain-name.com 我的 vbulletin 论坛在我有 rails 应用程序的顶级域上设置了一些 cookie beta.domain-name.com。是否可以在我的应用程序中读取这些顶级 cookie?我怎样才能做到这一点?
domain-name.com
beta.domain-name.com
是的,这是可能的。
您需要将域属性指定为:domain => .domain-name.com
:domain => .domain-name.com
例如:
cookies[:your_cookie] = {:value => 'something', :domain => '.domain-name.com'}
现在,可以在*.domain-name.com和中访问 cookie domain-name.com。
*.domain-name.com