Re: Cookie Problems on Localhost

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



M. Sokolewicz wrote:

Joseph L. Mueller wrote:

I am testing some PHP code (example 15.5 from Sams Teach Yourself PHP MySQL, PHP and Apache in 24 Hours). I am running running PHP 5.0.3 and Apache 2.0.43 on my WinXp Home system.

My problem is I cannot seem to set a cookie.
<?php
setcookie("vegetable", "artichoke", time()+3600, "/", "127.0.0.1", 0);
?>

I tried using "localhost" and "127.0.0.1" for the domain parameter, but that does not seem to work. I have tried this with botn Mozilla 1.7.3 and Internet Explorer to no avail.

both 'localhost' and any ip are not accepted as valid domain-identifiers in cookies (as per RFC). This simply means you're best off leaving them empty.



Any pointers would be welcome.

Thanks in advance.

That still leaves the problem of how to test cookies and sessions on a local system.

--
Joseph L. Mueller

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux