Re: Re: setcookie() and Max-Age
| From: | Christian Schneider | Date: | Wed, 18 Aug 2004 11:09:14 +0000 |
| Subject: | Re: Re: setcookie() and Max-Age | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-12214@lists.php.net to get a copy of this message | ||
Rasmus Lerdorf wrote:
How about this: setcookie('name',$value,array('Max-Age'=>3600, 'Comment'=>$comment, 'Path'=>'/');One drawback is that people have to know about the cookie specifications, e.g. 'Max-Age': Is it case sensitive, does it have a dash between max and age, etc? That should at least be well-covered in the documentation to avoid having to look at the RFC. [ Side-note: You forgot one closing parens, a common mistake with named parameters, I recommend the patch we're using which allows to leave out array(): setcookie('name', $value, 'Max-Age'=>3600, 'Comment'=>$comment, 'Path'=>'/'); *Evil grin* ] - Chris