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

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)




On Chrome

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



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s