All threads / Sharing Cookies with Subdomains in Rails Discussion

Ask A Question


You’re not receiving notifications from this thread.

Sharing Cookies with Subdomains in Rails Discussion

Would it be possible for you to add subtitles in Portuguese or English? I am Brazilian, I can understand English subtitles. If you can in English it helps a lot.


Is there a strategy for sharing a login session between two different domains?

That's what we covered in this episode?

As I understand it, the episode covered sharing credentials between subdomains of the same domain. For example, &

Is there a way of sharing credentials between and ?

No. Cookies are bound to the same TLD.


Would this work for authenticating from non Rails app on a subdomain? For example if we have a Rails app hosted at, and then a Next.js app on, could the Rails app authenticate API requests coming from using the session cookie?

Yep! Just make sure the cookie gets included in the request and that's it. 👍

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 51,723+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.