Click to See Complete Forum and Search --> : setcookie to an other site ?


patimages
11-22-2006, 06:14 AM
Hi everybody !

I have a little problem. My site is in two parts (mysite1.com and mysite2.com).
To prevent any problems, I want people to go to mysite1 and from there they will be redirected to mysite2. The problem is that some go directly to mysite2, get problem and fill my mailbox with complains !!! To prevent them to go to mysite2 directly, I was thinking to make a cookie on mysite1.com with a 5 minutes life that would be read by mysite2.com. If it does not exist or expired, people are sent back to mysite1.

The mega trouble is when I make a cookie on mysite1.com (setcookie('notlong', 'blah', mktime()+300, '/');
), I do not know how to have mysite2.com to read it ($cook = $_COOKIE['notlong']; )!!!! Just giving the name does not work !!!

can you help me ???

MatMel
11-22-2006, 06:37 AM
Perhaps setting the domain (http://de3.php.net/manual/en/function.setcookie.php) parameter to "mysite2.com" will help:

setcookie('notlong', 'blah', mktime()+300, '/', 'mysiter2.com');

patimages
11-22-2006, 06:57 AM
perfect !!!!! worked great !!! thanks!!!