reference/session/sessionhandler.xml
62126c55f1c6ed444043e7272c4f9e233818a44b
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<phpdoc:classref xml:id="class.sessionhandler" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
5
4

6
5
<title>The SessionHandler class</title>
...
...
@@ -32,7 +31,7 @@
32
31
<function>session_set_save_handler</function> it will wrap the current save handlers.
33
32
A class extending from <classname>SessionHandler</classname> allows you to override
34
33
the methods or intercept or filter them by calls the parent class methods which ultimately wrap
35
-
the interal PHP session handlers.
34
+
the internal PHP session handlers.
36
35
</para>
37
36
<para>
38
37
This allows you, for example, to intercept the <parameter>read</parameter> and <parameter>write</parameter>
...
...
@@ -51,9 +50,9 @@
51
50
<classname>SessionHandler</classname> or one extending it to <function>session_set_save_handler</function>.
52
51
</para>
53
52
<para>
54
-
Please note the callback methods of this class are designed to be called internally by
53
+
Please note that the callback methods of this class are designed to be called internally by
55
54
PHP and are not meant to be called from user-space code. The return values are equally processed internally
56
-
by PHP. For more information on the session workflow, please refer <function>session_set_save_handler</function>.
55
+
by PHP. For more information on the session workflow, please refer to <function>session_set_save_handler</function>.
57
56
</para>
58
57
</section>
59
58
<!-- }}} -->
...
...
@@ -62,29 +61,31 @@
62
61
&reftitle.classsynopsis;
63
62

64
63
<!-- {{{ Synopsis -->
65
-
<classsynopsis>
66
-
<ooclass><classname>SessionHandler</classname></ooclass>
64
+
<classsynopsis class="class">
65
+
<ooclass>
66
+
<classname>SessionHandler</classname>
67
+
</ooclass>
67
68

68
-
<!-- {{{ Class synopsis -->
69
-
<classsynopsisinfo>
70
-
<ooclass>
71
-
<classname>SessionHandler</classname>
72
-
</ooclass>
69
+
<oointerface>
70
+
<modifier>implements</modifier>
71
+
<interfacename>SessionHandlerInterface</interfacename>
72
+
</oointerface>
73
73

74
-
<oointerface>
75
-
<interfacename>SessionHandlerInterface</interfacename>
76
-
</oointerface>
77
-
</classsynopsisinfo>
78
-
<!-- }}} -->
74
+
<oointerface>
75
+
<interfacename>SessionIdInterface</interfacename>
76
+
</oointerface>
79
77

80
78
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
81
-
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.sessionhandler')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
79
+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.sessionhandler')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='SessionHandler'])">
80
+
<xi:fallback/>
81
+
</xi:include>
82
82
</classsynopsis>
83
83
<!-- }}} -->
84
84

85
85
</section>
86
86

87
87
<section xml:id="session.notes">
88
+
&reftitle.notes;
88
89
<warning>
89
90
<para>
90
91
This class is designed to expose the current internal PHP session save handler, if you want to
...
...
@@ -94,31 +95,8 @@
94
95
</warning>
95
96
</section>
96
97

97
-
<section role="changelog" xml:id="sessionhandler.changelog"><!-- {{{ -->
98
-
&reftitle.changelog;
99
-
<para>
100
-
<informaltable>
101
-
<tgroup cols="2">
102
-
<thead>
103
-
<row>
104
-
<entry>&Version;</entry>
105
-
<entry>&Description;</entry>
106
-
</row>
107
-
</thead>
108
-
<tbody>
109
-
<row>
110
-
<entry>5.5.1</entry>
111
-
<entry>
112
-
Added <function>SessionHandler::create_sid</function>.
113
-
</entry>
114
-
</row>
115
-
</tbody>
116
-
</tgroup>
117
-
</informaltable>
118
-
</para>
119
-
</section><!-- }}} -->
120
-

121
98
<section xml:id="sessionhandler.examples">
99
+
&reftitle.examples;
122
100
<example>
123
101
<title>
124
102
Using <classname>SessionHandler</classname> to add encryption to internal PHP save handlers.
...
...
@@ -162,8 +140,8 @@ function decrypt($edata, $password) {
162
140
* @return base64 encrypted data
163
141
*/
164
142
function encrypt($data, $password) {
165
-
// Set a random salt
166
-
$salt = openssl_random_pseudo_bytes(16);
143
+
// Generate a cryptographically secure random salt using random_bytes()
144
+
$salt = random_bytes(16);
167
145

168
146
$salted = '';
169
147
$dx = '';
...
...
@@ -226,7 +204,7 @@ session_start();
226
204
<para>
227
205
Since this class' methods are designed to be called internally by PHP as part of the normal session workflow,
228
206
child class calls to parent methods (i.e. the actual internal native handlers) will return &false; unless
229
-
the session has actually been started (either automatically, or by explicit <function>session_start</function>.
207
+
the session has actually been started (either automatically, or by explicit <function>session_start</function>).
230
208
This is important to consider when writing unit tests where the class methods might be invoked manually.
231
209
</para>
232
210
</note>
...
...
@@ -237,7 +215,6 @@ session_start();
237
215
&reference.session.entities.sessionhandler;
238
216

239
217
</phpdoc:classref>
240
-

241
218
<!-- Keep this comment at the end of the file
242
219
Local variables:
243
220
mode: sgml
244
221