PHP – setcookie(); not working
You have to set cookies before any headers are sent out. From the manual: setcookie() defines a cookie to be sent along with the rest of the HTTP headers. Like other headers, cookies must be sent before any output from your script (this is a protocol restriction). This requires that you place calls to this function prior to … Read more