Share browser cookies across different servers and port numbers

We end up running our(single) app on multiple mongrels (a rails web server) in development.So naturally there is a need for sharing the cookies across these servers as if it is a single server(like in the production mode).

Except some versions of Internet Explorer all browsers by default treat different ports ( running on the same localhost machine) as different domains and block cooking from
being transferred one to other. Also noticed cookies set for localhost:3001  are not transferred to 127.0.0.1:3001.

This problem is also known as same origin policy.

There are multiple ways to get around this problem. The first one is to run an apache server and route the requests to either servers.

The other simpler solution is to disable security( i.e., same origin policy) in the browsers.

I prefer the second one as it is easy (at least to me).

On Firefox.

Try ( I could not get this one work though. YMMV)

https://addons.mozilla.org/en-US/firefox/addon/forcecors/

 

 

 

On Chrome

/opt/google/chrome/google-chrome –disable-web-security

References

http://stackoverflow.com/questions/3102819/chrome-disable-same-origin-policy

Hello world!

Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.

Here are some suggestions for your first post.

  1. You can find new ideas for what to blog about by reading the Daily Post.
  2. Add PressThis to your browser. It creates a new blog post for you about any interesting  page you read on the web.
  3. Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.