reference/network/functions/header.xml
5c1ccc6e24e5d470e75ef0a5887c2ff583266375
...
...
@@ -219,6 +219,27 @@ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
219
219
</para>
220
220
</example>
221
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>
222
243
</refsect1>
223
244

224
245
<refsect1 role="notes">
225
246