Forum Moderators: coopster
In CODE words
==============================
// This works:
setcookie("test", "test", time()+3600);
session_start();
==============================
// This does NOT work:
session_start();
setcookie("test", "test", time()+3600);
WHY?
I just know, that there isn't any html allowed before, nor any function.
So these two won't work:
function my()
{
return true;
}
my();
setcookie(...);
nor
echo "";
setcookie(...);
If the code setcookie(..);session_start(); works for you, then use it.
Best regards
Michal Cibor
PS There's a possibility to set a cookie after headers sent -use javascript onload.