Re: cookies on localhost WinXP
| From: | Steve Buehler | Date: | Wed, 30 Jul 2003 20:28:28 +0000 |
| Subject: | Re: cookies on localhost WinXP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-157595@lists.php.net to get a copy of this message | ||
hmmmmm. Looks like on my localhost I can't seta cookie like this:
setcookie ("coach_access[login_id]", "coach",0,"/","$cookhost");
if I change it to just:
setcookie ("coach_access_login_id", "coach",0,"/","$cookhost");
it will work. But then my script won't work without a lot of re-writing because it uses $coach_access[login_id] instead. Any help here? Am I just doing something wrong? I can't set it with the following either.
header('Set-Cookie: coach_access[login_id]=coach');
But can as:
header('Set-Cookie: coach_access_login_id_=coach');
but again, I would have to re-write a lot of script.
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/