Question: I am trying to coordinate cookies that were set by setcookie in PHP with cookie in Rails. The problem is when I set the cookie to localhost domain in PHP with COOKIE\_DOMAIN false it sets it to domain 127.0.0.1. However Rails settings to localhost domain instead of 127.0.0.1 domain uses localhost. Therefore I have two different domains (127.0.0.1 and localhost) to localhost domain. How can I fix it, to set the cookie explicitly to localhost domain with setcookie.

Thanks!

Answer: 
The cookie's domain depends on the current domain when the cookie is set. Make sure both your applications are pointing to `localhost` - then it should work.
`bool setcookie ( string $name [, string $value [, int $expire = 0 [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]]]] )`

You need to set `$domain` manually to 'localhost'