Two domains pointed at the same site, can't log in to one of them
I had this issue before. It is related to the cookie setting, try doing this:

&lt;?php
if (isset($_SERVER['HTTP_HOST']) &amp;&amp; substr_count($_SERVER['HTTP_HOST'], 'parentdomain.com') &gt; 0) {
$cookie_domain = '.parentdomain.com';
}
?&gt;