reference/session/functions/session-name.xml
c35c07ab6a9cf533455947147634399fc928f6ca
...
...
@@ -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-name">
3
+
<refentry xml:id="function.session-name" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>session_name</refname>
6
6
<refpurpose>Get and/or set the current session name</refpurpose>
...
...
@@ -9,8 +9,8 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>string</type><methodname>session_name</methodname>
13
-
<methodparam choice="opt"><type>string</type><parameter>name</parameter></methodparam>
12
+
<type class="union"><type>string</type><type>false</type></type><methodname>session_name</methodname>
13
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>name</parameter><initializer>&null;</initializer></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
16
<function>session_name</function> returns the name of the current
...
...
@@ -48,7 +48,7 @@
48
48
used in cookies and URLs (e.g. <literal>PHPSESSID</literal>). It
49
49
should contain only alphanumeric characters; it should be short and
50
50
descriptive (i.e. for users with enabled cookie warnings).
51
-
If <parameter>name</parameter> is specified, the name of the current
51
+
If <parameter>name</parameter> is specified and not &null;, the name of the current
52
52
session is changed to its value.
53
53
</para>
54
54
<para>
...
...
@@ -70,32 +70,11 @@
70
70
<para>
71
71
Returns the name of the current session. If <parameter>name</parameter> is given
72
72
and function updates the session name, name of the <emphasis>old</emphasis> session
73
-
is returned.
73
+
is returned, &return.falseforfailure;.
74
74
</para>
75
75
</refsect1>
76
76

77
-
<refsect1 role="examples">
78
-
&reftitle.examples;
79
-
<para>
80
-
<example>
81
-
<title><function>session_name</function> example</title>
82
-
<programlisting role="php">
83
-
<![CDATA[
84
-
<?php
85
-

86
-
/* set the session name to WebsiteID */
87
-

88
-
$previous_name = session_name("WebsiteID");
89
-

90
-
echo "The previous session name was $previous_name<br />";
91
-
?>
92
-
]]>
93
-
</programlisting>
94
-
</example>
95
-
</para>
96
-
</refsect1>
97
-

98
-
<refsect1 role="changelog">
77
+
<refsect1 role="changelog">
99
78
&reftitle.changelog;
100
79
<para>
101
80
<informaltable>
...
...
@@ -108,6 +87,12 @@ echo "The previous session name was $previous_name<br />";
108
87
</thead>
109
88
<tbody>
110
89
<row>
90
+
<entry>8.0.0</entry>
91
+
<entry>
92
+
<parameter>name</parameter> is nullable now.
93
+
</entry>
94
+
</row>
95
+
<row>
111
96
<entry>7.2.0</entry>
112
97
<entry>
113
98
<function>session_name</function> checks session status,
...
...
@@ -124,6 +109,27 @@ echo "The previous session name was $previous_name<br />";
124
109
</para>
125
110
</refsect1>
126
111

112
+
<refsect1 role="examples">
113
+
&reftitle.examples;
114
+
<para>
115
+
<example>
116
+
<title><function>session_name</function> example</title>
117
+
<programlisting role="php">
118
+
<![CDATA[
119
+
<?php
120
+

121
+
/* set the session name to WebsiteID */
122
+

123
+
$previous_name = session_name("WebsiteID");
124
+

125
+
echo "The previous session name was $previous_name<br />";
126
+
?>
127
+
]]>
128
+
</programlisting>
129
+
</example>
130
+
</para>
131
+
</refsect1>
132
+

127
133
<refsect1 role="seealso">
128
134
&reftitle.seealso;
129
135
<para>
...
...
@@ -137,7 +143,6 @@ echo "The previous session name was $previous_name<br />";
137
143
</refsect1>
138
144

139
145
</refentry>
140
-

141
146
<!-- Keep this comment at the end of the file
142
147
Local variables:
143
148
mode: sgml
144
149