I had a case where I had to share a cookie between two different hosts but for the same domain. For example I had a www.mysite.com which was running on rails and other.mysite.com which was running php app. Obviously for the purpose of single signon that had to share same cookie that would be preset in rails app.
I found answer here
All I had to do is set :domain key in the cookie parameters
cookies[:user] = {:value => id.to_s,:domain => 'mysite.com'}
EXTRA: to check whether your rails app is actually setting the right cookie go to security preferences and make sure that you see your cookie key to be set for the domain without the host.