so now I can set/delete the cookies[:login] according to user authentication w FB/Google and originated subdomain ( parameter :state in URL)
on signout, I have to delete the cookies[:login], on redirection I have to check if the cookies[:login] is related to the subdomain else delete it…
great post and link about it :
Quoted- As it turns outs ‘domain: all’ creates a cookie for all the different subdomains that are visited during that session (and it ensures that they are passed around between request).
If no domain argument is passed, it means that a new cookie is created for every different domain that is visited in the same session and the old one gets discarded.
What I needed was a single cookie that is persistent throughout the session, even when the domain changes. Hence, passing ‘domain: lvh.me’ solved the problem in development. This creates a single cookie that stays there between different subdomains.