Forum Moderators: phranque

Message Too Old, No Replies

Anyone with phpsuexec experience?

Cookies all messed up

         

craig1972

1:27 pm on Aug 2, 2003 (gmt 0)

10+ Year Member



Anyone here with phpsuexec experience? My host has installed it and now my cookies are all messed up. For instance, in the following code:


<?

$cookieLife = 60000000;
$cookieExpire = gmstrftime("%A, %d-%b-%Y %H:%M:%S GMT",time()+$cookieLife);

header("Set-Cookie: a=50; expires=$cookieExpire");
header("Set-Cookie: b=test; expires=$cookieExpire");
header("Set-Cookie: c=test; expires=$cookieExpire");
header("Set-Cookie: d=test; expires=$cookieExpire");
header("Set-Cookie: e=test; expires=$cookieExpire");
header("Set-Cookie: f=test; expires=$cookieExpire");

while (list ($key, $val) = each ($_COOKIE)) {
echo "$key => $val<br />\n";
}

?>

On my machine (Win xp) it shows up perfectly, 6 cookies are displayed. On my hosting site now (Redhat Linux, PHP as a module, and PHPSUEXEC) only the last cookie is set.

Any ideas how this can be fixed? Thanks so much in advance!

jatar_k

5:09 pm on Aug 2, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I would suggest using only 1 cookie for any given site. I have had many problems over the years using multiple cookies.

If I need to set multiple values I use serialize [ca2.php.net] and store them in a single cookie.