Re: header() removes all header of the same name.
| From: | Yasuo Ohgaki | Date: | Thu, 20 Oct 2016 21:41:31 +0000 |
| Subject: | Re: header() removes all header of the same name. | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-96529@lists.php.net to get a copy of this message | ||
Hi Stats,
On Fri, Oct 21, 2016 at 5:54 AM, Stanislav Malyshev <smalyshev@gmail.com> wrote:
>
>> The idea is to separate HTTP header handling functions.
>>
>> - header*() for any HTTP headers except 'Set-Cookie'
>> - cookie*() for only 'Set-Cookie' header
>
> This does not look like a good design. First of all, HTTP spec allows
> multiple instances of any header. Second, making function with unobvious
> gotcha branch is usually bad design. Third, we are solving non-existing
> problem here - people should just use existing functions correctly and
> everything would be fine.
> Let's not spend any more time on this.
OK. 4 people not in favor of Set-Cookie restriction for header*().
What about API clean up?
Since we have setcookie()/setrawcookie() already, we may clean up
current cookie API
e.g.
- cookie_set/setcookie($name, [$value, [array $options]])
(Keep current signature also)
- cookie_set_raw/setrawcookie($name, [$value, [array $options]])
(Keep current signature also)
- cookie_remove($name), cookie_list()
(These may be optional to you)
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net