when a php header() function is used to set multiple cookies, only the last cookie works. All other cookie set attempts before are discarded. For example:
header("Set-Cookie: cookie1=fox; expires=Mon, 28-Sep-20 10:24:49 GMT; path=/");
header("Set-Cookie: cookie2=fish; expires=Mon, 28-Sep-20 10:24:49 GMT; path=/");
only cookie2 is set here. How can i set several cookies successfully by using header() method?
(header method also discards the setcookie functions sent before)
false. An read the doc php.net/manual/fr/function.header.php !