guvenck
08-10-2007, 11:43 AM
Hello,
I set my cookies using setcookie like this for exp:
setcookie("username", $_SESSION['username'], 2147483647, "/", ".$cookiedomain", 0);
where $cookiedomain is my domain name without www, like mydomain.com, mysite.net etc.
My question is, can I get this variable automatically from an environment or server variable? $_SERVER["HTTP_HOST"] gives something like www.mydomain.com and I could trim it but will it give correct value on every server? And, which one is more reliable, ENV or SERVER?
Thanks,
I set my cookies using setcookie like this for exp:
setcookie("username", $_SESSION['username'], 2147483647, "/", ".$cookiedomain", 0);
where $cookiedomain is my domain name without www, like mydomain.com, mysite.net etc.
My question is, can I get this variable automatically from an environment or server variable? $_SERVER["HTTP_HOST"] gives something like www.mydomain.com and I could trim it but will it give correct value on every server? And, which one is more reliable, ENV or SERVER?
Thanks,