Re: cookies on localhost WinXP
| From: | Steve Buehler | Date: | Wed, 30 Jul 2003 20:55:37 +0000 |
| Subject: | Re: cookies on localhost WinXP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157601@lists.php.net to get a copy of this message | ||
That still won't work for me for some reason. I am just going to rewrite parts of the script to use a cookie name with out a [something] IN the name. I will rename it to ca_id or something like that.
Thanks for your help
Steve
At 01:38 PM 7/30/2003 -0700, you wrote:
--- Steve Buehler <steve@ibapp.com> wrote: header('Set-Cookie: coach_access[login_id]=coach'); Well, that is ugly, but it is actually a valid name. The name of a cookie, as described by http://wp.netscape.com/newsref/std/cookie_spec.html, is "a sequence of characters excluding semi-colon, comma and white space." Now, when a browser sends this, it will be something like this: Cookie: coach_access[login_id]=coach PHP, in an effort to interpret this "coach_access[login_id]" as a valid variable name, will actually translate it into an array, so this will be similar to: $_COOKIE['coach_access']['login_id'] = 'coach'; Is this what you mean to do? It is best (in my opinion) to stick with normal names for your cookies - names that would make valid variable names. Hope that helps. Chris ===== Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- This message has been scanned for viruses and dangerous content by the MailScanner at ow4, and is believed to be clean.