Re: Anyone for cookies and milk? :-)
| From: | Chris Shiflett | Date: | Wed, 16 Jul 2003 21:41:31 +0000 |
| Subject: | Re: Anyone for cookies and milk? :-) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155494@lists.php.net to get a copy of this message | ||
--- Ryan A <ryan@jumac.com> wrote:
> Am just getting into PHP cookies and have gotten a problem...(surprise
> surprise)
>
> Am trying to set a basic cookie to see exactly how things work before I
> start using it in my apps, heres the code i am using:
> (SetCookieEx.php)
> <?php
>
> setcookie("name1","1","","",".bestwebhosters.com");
>
> setcookie("name2","1","","",".bestwebhosters.com");
I can never remember the attribute order for setcookie without looking it up,
and I prefer to just use header() to set my own Set-Cookie header. A simple
example for just testing things would go something like this:
header('Set-Cookie: foo=bar');
Hope that helps.
Chris
=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/