Share one single cookie through subdomains

cookies, ruby-on-rails, ruby-on-rails-3, ruby-on-rails-3.2, subdomain

Solution

All I needed to do was to specify the domain when creating the cookie, as commented earlier above.

cookies[:remember_token] = { value: user.remember_token, domain: ".lvh.me" }

Problem

I have a blogs subdomain that works well, however, the signin is detached from all subdomains, and consequently, if a user signs in his cookie is only valid on the non-subdomain pages. How can I set my app to make the cookies be valid throughout all subdomains and normal pages? I worked through this topic: Share session (cookies) between subdomains in Rails? but unfortunately without success. I even tried that long step by step rack middleware approach but wihtout success. I am using Rails 3.2.13. Any help appreciated! :)

Original source

Related problems