Hello,
Please help me how to create cookies for multiple domain

I have to website in have addonn domain

I want to long in site a.com and site b.com
all 2 website has same username and database.
when log to site a.com should be able to login to site b.com with same cookies


1. setcookie("musername",$_POST['username'],time() + COOKIE_EXPIRE, COOKIE_PATH);
-or.
2. $_SESSION['musername']=$_POST['username'];

cannot log to site b.com
any suggestion?

Thnk