Hi There,
I am a beginner PHP developer and I have a very simple, perhaps silly,
question:
I am trying to use the setcookie function in a PHP script and I seem to be
struggling with the "domain" parameter. Here is situation:
//set authorization cookie
setcookie("auth", "1", 0, "/", "yourdomain.com", 0);
Instead of the "yourdomain.com" string in this function call I am suppose to
use my own domain name, but I do not have a WEB site yet. As a result I am
using localhost at the moment. I have tried several values with no success.
Since I am running these scripts on my local PC using "i.e. localhost", what
should I set this value to?
I have tried the following combinations with no avail:
setcookie("auth", "1", 0, "/", "localhost", 0);
setcookie("auth", "1", 0, "/", "localhost:8080", 0); (I a running Apache
HTTP Server 2.0.54 on port 8080)
setcookie("auth", "1", 0, "/", "127.0.0.1", 0);
setcookie("auth", "1", 0, "/", ".oc.cox.net", 0); (this is what my IPCONFIG
returns as my "connection-specific DNS Suffix".)
Any help would be greatly appreciated.
Regards,
Tony Aldemir