Error with cookie
Posted: Tue Apr 01, 2003 11:12 am
Warning: Cannot add header information - headers already sent by (output started at /usr/local/psa/home/vhosts/xxxxx.com/httpdocs/dmd/header.php:26) in /usr/local/psa/home/vhosts/xxxxx.com/httpdocs/dmd/cart.php on line 12
Thats the function:
function GetCartId()
{
if(isset($_COOKIE["cartid"]))
{
return $_COOKIE["cartid"];
}
else
{
session_start();
setcookie("cartid", session_id(), time() + ((3600 * 24) * 30));
return session_id();
}
}
Don't know whats wrong with this:
setcookie("cartid", session_id(), time() + ((3600 * 24) * 30));
Can someone helps me?
Cheerz
Kris
Thats the function:
function GetCartId()
{
if(isset($_COOKIE["cartid"]))
{
return $_COOKIE["cartid"];
}
else
{
session_start();
setcookie("cartid", session_id(), time() + ((3600 * 24) * 30));
return session_id();
}
}
Don't know whats wrong with this:
setcookie("cartid", session_id(), time() + ((3600 * 24) * 30));
Can someone helps me?
Cheerz
Kris