Re: cookies on localhost WinXP
| From: | Steve Buehler | Date: | Wed, 30 Jul 2003 20:14:23 +0000 |
| Subject: | Re: cookies on localhost WinXP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157591@lists.php.net to get a copy of this message | ||
hmmmm. This seemed to set the cookie just fine. Does this mean that either localhost in the browser or Apache/PHP on a windows box has to set the cookie differently than on RedHat/Apache/PHP? I am going on vacation next week and need to keep working on a project that is working fine on the RedHat server, but not on my localhost. Basically, by this test, it sounds like on my laptop I have to use a
header('Set-Cookie: ...);
instead of
setcookie ("coach_access[login_id]", "coach",0,"/","$cookhost");
If so, I can't seem to get it to work with "coach_access[login_id]" as the cookie name.
On another note, why would this work on the RedHat, but not the WinXP Apache/PHP?
Thanks
Steve
At 12:34 PM 7/30/2003 -0700, Chris Shiflett wrote:
Can you try this example? Let's call the file cookie_test.php <? if (!empty($_COOKIE['test'])) {echo "The test cookie was sent by the browser\n";} else {header('Set-Cookie: test=true'); echo "Trying to set the test cookie.<br />\n"; echo "<a href=\"./cookie_test.php\">Test</a>\n";} ?> I think it's best to start simple. Hope this helps. Chris ===== Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/