Re: Why does `setcookie` send header before throwing `Error` exception?
[email protected] (Jair López)
| Newsgroups | php.general |
|---|---|
| Message-ID | <PH0PR15MB43668EB4FB2A3DC750A49D3FE8789@PH0PR15MB4366.namprd15.prod.outlook.com> |
Thanks for your reply JEFFRY KILLEN,
> Could it be sending the header and then choking
> because ‘path’ doesn’t have a valid value assignment?
Maybe, but it does not happen when using this invocation:
setcookie('name', 'value', 1, new Foo());
which should be equivalent to:
setcookie('name', 'value', array(
'expires' => 1,
'path' => new Foo()
));
The fatal error that they throw is not the issue I'm referring to, but
the fact that one syntax sends the `Set-Cookie` response header but the
other one does not.