I am developing on my Mac laptop, I am using MAMP. I am trying to set a cookie with PHP and I cannot. I refused the domain, I tried using "\" for the domain. Bad luck.
setcookie("username", "George", false, "/", false);
setcookie("name","Joe");
I have to miss something obvious. I need a quick and easy solution. There is one?
I am not doing anything, just loading (via MAMP) the page,
http: // localhost: 8888 / MAMP / lynn / setcookie.php
That the script has setcookie code at the top before writing HTML tags. (although I also tried it in the BODY). I load the page in various browsers and then open the list of cookies. I know that browsers accept cookies because I see the current ones in the list. Just not my new one.
source
share