reference/session/functions/session-unset.xml
682510e91d1f19fb59d2f7aef6ab370e8af842a1
...
...
@@ -9,7 +9,7 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>void</type><methodname>session_unset</methodname>
12
+
<type>bool</type><methodname>session_unset</methodname>
13
13
<void/>
14
14
</methodsynopsis>
15
15
<para>
...
...
@@ -18,30 +18,70 @@
18
18
</para>
19
19
</refsect1>
20
20

21
+
<refsect1 role="parameters">
22
+
&reftitle.parameters;
23
+
&no.function.parameters;
24
+
</refsect1>
25
+

21
26
<refsect1 role="returnvalues">
22
27
&reftitle.returnvalues;
23
28
<para>
24
-
&return.void;
29
+
&return.success;
25
30
</para>
26
31
</refsect1>
27
32

33
+
<refsect1 role="changelog">
34
+
&reftitle.changelog;
35
+
<informaltable>
36
+
<tgroup cols="2">
37
+
<thead>
38
+
<row>
39
+
<entry>&Version;</entry>
40
+
<entry>&Description;</entry>
41
+
</row>
42
+
</thead>
43
+
<tbody>
44
+
<row>
45
+
<entry>7.2.0</entry>
46
+
<entry>
47
+
The return type of this function is <type>bool</type> now.
48
+
Formerly, it has been <type>void</type>.
49
+
</entry>
50
+
</row>
51
+
</tbody>
52
+
</tgroup>
53
+
</informaltable>
54
+
</refsect1>
55
+

28
56
<refsect1 role="notes">
29
57
&reftitle.notes;
30
58
<note>
31
59
<para>
32
-
If <varname>$_SESSION</varname> (or <varname>$HTTP_SESSION_VARS</varname>
33
-
for PHP 4.0.6 or less) is used, use <function>unset</function> to
60
+
If <varname>$_SESSION</varname> is used, use <function>unset</function> to
34
61
unregister a session variable, i.e.
35
-
<literal>unset ($_SESSION['varname']);</literal>.
62
+
<code>unset($_SESSION['varname']);</code>.
36
63
</para>
37
64
</note>
38
65
<caution>
39
66
<para>
40
67
Do NOT unset the whole <varname>$_SESSION</varname> with
41
-
<literal>unset($_SESSION)</literal> as this will disable the registering
68
+
<code>unset($_SESSION)</code> as this will disable the registering
42
69
of session variables through the <varname>$_SESSION</varname> superglobal.
43
70
</para>
44
71
</caution>
72
+
<note>
73
+
<para>
74
+
The use of <function>session_unset</function> is identical to <code>$_SESSION = []</code>.
75
+
</para>
76
+
</note>
77
+
<caution>
78
+
<para>
79
+
This function works only if a session is active. It will not clear the
80
+
<varname>$_SESSION</varname> array if the session has not been started yet
81
+
or has already been destroyed. Use <code>$_SESSION = []</code> to unset all
82
+
session variables even if the session is not active.
83
+
</para>
84
+
</caution>
45
85
</refsect1>
46
86

47
87
</refentry>
48
88