reference/network/functions/header.xml
5c1ccc6e24e5d470e75ef0a5887c2ff583266375
...
...
@@ -146,6 +146,14 @@ header('WWW-Authenticate: NTLM', false);
146
146
</para>
147
147
</refsect1>
148
148

149
+
<refsect1 role="errors">
150
+
&reftitle.errors;
151
+
<para>
152
+
On failure to schedule the header to be sent, <function>header</function>
153
+
issues an <constant>E_WARNING</constant> level error.
154
+
</para>
155
+
</refsect1>
156
+

149
157
<refsect1 role="examples">
150
158
&reftitle.examples;
151
159
<para>
...
...
@@ -211,6 +219,27 @@ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
211
219
</para>
212
220
</example>
213
221
</para>
222
+
<para>
223
+
<example>
224
+
<title>Setting a cookie</title>
225
+
<para>
226
+
<function>setcookie</function> provides a convenient way to set cookies.
227
+
To set a cookie that includes attributes which <function>setcookie</function>
228
+
doesn't support, <function>header</function> can be used.
229
+
</para>
230
+
<para>
231
+
For example, the following sets a cookie that includes a
232
+
<literal>Partitioned</literal> attribute.
233
+
</para>
234
+
<programlisting role="php">
235
+
<![CDATA[
236
+
<?php
237
+
header('Set-Cookie: name=value; Secure; Path=/; SameSite=None; Partitioned;');
238
+
?>
239
+
]]>
240
+
</programlisting>
241
+
</example>
242
+
</para>
214
243
</refsect1>
215
244

216
245
<refsect1 role="notes">
...
...
@@ -238,14 +267,6 @@ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
238
267
</note>
239
268
<note>
240
269
<para>
241
-
There is a bug in Microsoft Internet Explorer 4.01 that prevents
242
-
this from working. There is no workaround. There is also a bug
243
-
in Microsoft Internet Explorer 5.5 that interferes with this,
244
-
which can be resolved by upgrading to Service Pack 2 or later.
245
-
</para>
246
-
</note>
247
-
<note>
248
-
<para>
249
270
Most contemporary clients accept relative <acronym>URI</acronym>s as argument to
250
271
<link xlink:href="&spec.http1.1;#section-7.1.2">Location:</link>,
251
272
but some older clients require an absolute URI
...
...
@@ -288,6 +309,7 @@ exit;
288
309
<member><function>setcookie</function></member>
289
310
<member><function>http_response_code</function></member>
290
311
<member><function>header_remove</function></member>
312
+
<member><function>headers_list</function></member>
291
313
<member>
292
314
The section on <link linkend="features.http-auth">HTTP
293
315
authentication</link>
294
316