How can I set the path when setcookie does not set the expiration time? The following write methods do not take effect: setcookie (mycookie, 11,); setcookie (mycookie, 11,); setcookie (mycookie, 11,); but the write method is as follows: setcookie (mycookie, 11, time () + 31104 may I ask if setcookie does not set the Expiration time? how to set the path?
The following write methods do not take effect:
Setcookie (mycookie, '11 ','','/');
Setcookie (mycookie, '11 ',,'/');
Setcookie (mycookie, '11 ','/');
But write it like this:
Setcookie (mycookie, '11', time () + 31104000 ,'/');
But I don't want to point to the expiration time. I want to delete the COOKIE as soon as I close the browser.
I did not know how to write this case after reading the online tutorials.
Who can help me? thank you!
Share:
------ Solution --------------------
Setcookie ('mycooker', '11', 0 ,'/');
------ Solution --------------------
Is it clear in the manual?
Because the expire parameter is an integer, it cannot be replaced by zero (0 ).