[eluser]WanWizard[/eluser]
The manual states that that only the name and the value are required.
This seems not to be true. If you use
Code:
set_cookie('pr', '10');
and monitor the requests and reponses, I see the cookie getting set, but with an expiry date 24 hours in the past. Which means that the cookie expires immediately, and that's why you don't see anything.
If you use
Code:
set_cookie('pr', '10', 0);
it is set correctly, and is valid until you close the browser.
If you look into the code, you'll see that 'expire' has an empty string as default, and further in the code, it says
Code:
if ( ! is_numeric($expire))
{
$expire = time() - 86500;
}
So the manual is wrong at this point. I just checked 2.0 code, where the function is moved to the input class, but the same error exists there.
I suggest you report this in the bug forum, so it can be fixed by Ellislabs.