reference/session/functions/session-set-cookie-params.xml
37be0e0626e8b96e617e800392651eacc5f65bdc
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.session-set-cookie-params">
3
+
<refentry xml:id="function.session-set-cookie-params" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>session_set_cookie_params</refname>
6
6
<refpurpose>Set the session cookie parameters</refpurpose>
...
...
@@ -8,17 +8,18 @@
8
8

9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
-
<methodsynopsis role="procedural">
11
+
<methodsynopsis>
12
12
<type>bool</type><methodname>session_set_cookie_params</methodname>
13
-
<methodparam><type>int</type><parameter>lifetime</parameter></methodparam>
14
-
<methodparam choice="opt"><type>string</type><parameter>path</parameter></methodparam>
15
-
<methodparam choice="opt"><type>string</type><parameter>domain</parameter></methodparam>
16
-
<methodparam choice="opt"><type>bool</type><parameter>secure</parameter><initializer>&false;</initializer></methodparam>
17
-
<methodparam choice="opt"><type>bool</type><parameter>httponly</parameter><initializer>&false;</initializer></methodparam>
13
+
<methodparam><type>int</type><parameter>lifetime_or_options</parameter></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>path</parameter><initializer>&null;</initializer></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>domain</parameter><initializer>&null;</initializer></methodparam>
16
+
<methodparam choice="opt"><type class="union"><type>bool</type><type>null</type></type><parameter>secure</parameter><initializer>&null;</initializer></methodparam>
17
+
<methodparam choice="opt"><type class="union"><type>bool</type><type>null</type></type><parameter>httponly</parameter><initializer>&null;</initializer></methodparam>
18
18
</methodsynopsis>
19
-
<methodsynopsis role="procedural">
19
+
<para>Alternative signature available as of PHP 7.3.0:</para>
20
+
<methodsynopsis>
20
21
<type>bool</type><methodname>session_set_cookie_params</methodname>
21
-
<methodparam><type>array</type><parameter>options</parameter></methodparam>
22
+
<methodparam><type>array</type><parameter>lifetime_or_options</parameter></methodparam>
22
23
</methodsynopsis>
23
24
<para>
24
25
Set cookie parameters defined in the &php.ini; file. The effect of this
...
...
@@ -37,12 +38,25 @@
37
38
<para>
38
39
<variablelist>
39
40
<varlistentry>
40
-
<term><parameter>lifetime</parameter></term>
41
+
<term><parameter>lifetime_or_options</parameter></term>
41
42
<listitem>
42
43
<para>
43
-
<link linkend="ini.session.cookie-lifetime">Lifetime</link> of the
44
+
When using the first signature, <link linkend="ini.session.cookie-lifetime">lifetime</link> of the
44
45
session cookie, defined in seconds.
45
46
</para>
47
+
<para>
48
+
When using the second signature,
49
+
an associative <type>array</type> which may have any of the keys
50
+
<literal>lifetime</literal>, <literal>path</literal>, <literal>domain</literal>,
51
+
<literal>secure</literal>, <literal>httponly</literal> and <literal>samesite</literal>.
52
+
The values have the same meaning as described for the parameters with the
53
+
same name. The value of the <literal>samesite</literal> element should be
54
+
either <literal>Lax</literal> or <literal>Strict</literal>.
55
+
If any of the allowed options are not given, their default values are the
56
+
same as the default values of the explicit parameters. If the
57
+
<literal>samesite</literal> element is omitted, no SameSite cookie
58
+
attribute is set.
59
+
</para>
46
60
</listitem>
47
61
</varlistentry>
48
62
<varlistentry>
...
...
@@ -84,23 +98,6 @@
84
98
</para>
85
99
</listitem>
86
100
</varlistentry>
87
-
<varlistentry>
88
-
<term><parameter>options</parameter></term>
89
-
<listitem>
90
-
<para>
91
-
An associative <type>array</type> which may have any of the keys
92
-
<literal>lifetime</literal>, <literal>path</literal>, <literal>domain</literal>,
93
-
<literal>secure</literal>, <literal>httponly</literal> and <literal>samesite</literal>.
94
-
The values have the same meaning as described for the parameters with the
95
-
same name. The value of the <literal>samesite</literal> element should be
96
-
either <literal>Lax</literal> or <literal>Strict</literal>.
97
-
If any of the allowed options are not given, their default values are the
98
-
same as the default values of the explicit parameters. If the
99
-
<literal>samesite</literal> element is omitted, no SameSite cookie
100
-
attribute is set.
101
-
</para>
102
-
</listitem>
103
-
</varlistentry>
104
101
</variablelist>
105
102
</para>
106
103
</refsect1>
...
...
@@ -125,23 +122,24 @@
125
122
</thead>
126
123
<tbody>
127
124
<row>
128
-
<entry>7.3.0</entry>
125
+
<entry>8.0.0</entry>
129
126
<entry>
130
-
An alternative signature supporting an <parameter>options</parameter>
131
-
array has been added. This signature supports also setting of the
132
-
SameSite cookie attribute.
127
+
<parameter>path</parameter>, <parameter>domain</parameter>,
128
+
<parameter>secure</parameter> and <parameter>httponly</parameter> are nullable now.
133
129
</entry>
134
130
</row>
135
131
<row>
136
-
<entry>7.2.0</entry>
132
+
<entry>7.3.0</entry>
137
133
<entry>
138
-
&return.success; Formerly the function returned <type>void</type>.
134
+
An alternative signature supporting an <parameter>lifetime_or_options</parameter>
135
+
&array; has been added. This signature supports also setting of the
136
+
SameSite cookie attribute.
139
137
</entry>
140
138
</row>
141
139
<row>
142
-
<entry>5.2.0</entry>
140
+
<entry>7.2.0</entry>
143
141
<entry>
144
-
The <parameter>httponly</parameter> parameter was added.
142
+
&return.success; Formerly the function returned <type>void</type>.
145
143
</entry>
146
144
</row>
147
145
</tbody>
...
...
@@ -178,7 +176,6 @@
178
176
</refsect1>
179
177

180
178
</refentry>
181
-

182
179
<!-- Keep this comment at the end of the file
183
180
Local variables:
184
181
mode: sgml
185
182