TransWikia.com

How to handle cookies across domains in development

Stack Overflow Asked by user3379926 on November 29, 2021

I developed two rails apps, they will each go on site.com and something.site.com respectively. In development mode they are run on localhost:3000 and localhost:4000, you must be logged into site.com to access something.site.com.

I have the cookies set up to handle domains from :all, and the tests all pass in relation to creating and destroying sessions. How ever I am unfamiliar how to test the cookies with out actually deploying the apps to production. I don’t have staging servers, their small basic apps and I don’t want them public. Is their any ways, on my mac, I can test (by launching both apps) the domain specific cookies?

3 Answers

Look at using POW and Powder. Runs slower, but allows you to run concurrent apps on localhost.

Pow User's Manual

Answered by bobbdelsol on November 29, 2021

I bet you could update your hosts file to point something.localhost to 127.0.0.1

127.0.0.1 something.localhost in `/etc/hosts

I'm sure you've read that as long as the TLD is the same, this should work.

Answered by Mario Olivio Flores on November 29, 2021

You can edit your hosts file located at /etc/hosts to point 127.0.0.1 to local.site.com and then access your rails apps at local.site.com:3000 and local.site.com:4000

127.0.0.1 localhost local.site.com

Answered by hjing on November 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP