@@ -13,16 +13,16 @@ Save Handlers
13
13
~~~~~~~~~~~~~
14
14
15
15
The PHP session workflow has 6 possible operations that may occur. The normal
16
- session follows `open `, `read `, `write ` and `close `, with the possibility of
17
- ` destroy ` and `gc ` (garbage collection which will expire any old sessions: ` gc `
18
- is called randomly according to PHP's configuration and if called, it is invoked
19
- after the `open ` operation). You can read more about this at
16
+ session follows `` open `` , `` read `` , `` write `` and `` close `` , with the possibility
17
+ of `` destroy `` and `` gc `` (garbage collection which will expire any old sessions:
18
+ `` gc `` is called randomly according to PHP's configuration and if called, it is
19
+ invoked after the `` open ` ` operation). You can read more about this at
20
20
`php.net/session.customhandler `_
21
21
22
22
Native PHP Save Handlers
23
23
------------------------
24
24
25
- So-called ' native' handlers, are save handlers which are either compiled into
25
+ So-called native handlers, are save handlers which are either compiled into
26
26
PHP or provided by PHP extensions, such as PHP-Sqlite, PHP-Memcached and so on.
27
27
28
28
All native save handlers are internal to PHP and as such, have no public facing API.
@@ -50,14 +50,16 @@ Example usage::
50
50
51
51
.. note ::
52
52
53
- With the exception of the ``files `` handler which is built into PHP and always available,
54
- the availability of the other handlers depends on those PHP extensions being active at runtime.
53
+ With the exception of the ``files `` handler which is built into PHP and
54
+ always available, the availability of the other handlers depends on those
55
+ PHP extensions being active at runtime.
55
56
56
57
.. note ::
57
58
58
- Native save handlers provide a quick solution to session storage, however, in complex systems
59
- where you need more control, custom save handlers may provide more freedom and flexibility.
60
- Symfony2 provides several implementations which you may further customize as required.
59
+ Native save handlers provide a quick solution to session storage, however,
60
+ in complex systems where you need more control, custom save handlers may
61
+ provide more freedom and flexibility. Symfony2 provides several implementations
62
+ which you may further customize as required.
61
63
62
64
Custom Save Handlers
63
65
--------------------
@@ -183,14 +185,14 @@ session is started. The session can be destroyed as required. This method of
183
185
processing can allow the expiry of sessions to be integrated into the user
184
186
experience, for example, by displaying a message.
185
187
186
- Symfony2 records some basic meta-data about each session to give you complete
188
+ Symfony2 records some basic metadata about each session to give you complete
187
189
freedom in this area.
188
190
189
- Session meta-data
190
- ~~~~~~~~~~~~~~~~~
191
+ Session metadata
192
+ ~~~~~~~~~~~~~~~~
191
193
192
- Sessions are decorated with some basic meta-data to enable fine control over the
193
- security settings. The session object has a getter for the meta-data ,
194
+ Sessions are decorated with some basic metadata to enable fine control over the
195
+ security settings. The session object has a getter for the metadata ,
194
196
:method: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Session::getMetadataBag ` which
195
197
exposes an instance of :class: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Storage\\ MetadataBag `::
196
198
@@ -199,7 +201,7 @@ exposes an instance of :class:`Symfony\\Component\\HttpFoundation\\Session\\Stor
199
201
200
202
Both methods return a Unix timestamp (relative to the server).
201
203
202
- This meta-data can be used to explicitly expire a session on access, e.g.::
204
+ This metadata can be used to explicitly expire a session on access, e.g.::
203
205
204
206
$session->start();
205
207
if (time() - $session->getMetadataBag()->getLastUsed() > $maxIdleTime) {
@@ -220,15 +222,15 @@ PHP 5.4 compatibility
220
222
221
223
Since PHP 5.4.0, :phpclass: `SessionHandler ` and :phpclass: `SessionHandlerInterface `
222
224
are available. Symfony provides forward compatibility for the :phpclass: `SessionHandlerInterface `
223
- so it can be used under PHP 5.3. This greatly improves inter-operability with other
225
+ so it can be used under PHP 5.3. This greatly improves interoperability with other
224
226
libraries.
225
227
226
228
:phpclass: `SessionHandler ` is a special PHP internal class which exposes native save
227
229
handlers to PHP user-space.
228
230
229
231
In order to provide a solution for those using PHP 5.4, Symfony2 has a special
230
232
class called :class: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Storage\\ Handler\\ NativeSessionHandler `
231
- which under PHP 5.4, extends from `\SessionHandler ` and under PHP 5.3 is just a
233
+ which under PHP 5.4, extends from `` \SessionHandler ` ` and under PHP 5.3 is just a
232
234
empty base class. This provides some interesting opportunities to leverage
233
235
PHP 5.4 functionality if it is available.
234
236
@@ -251,12 +253,12 @@ wrapped by one.
251
253
252
254
:class: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Storage\\ Handler\\ NativeProxy `
253
255
is used automatically under PHP 5.3 when internal PHP save handlers are specified
254
- using the `Native*SessionHandler ` classes, while
256
+ using the `` Native*SessionHandler ` ` classes, while
255
257
:class: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Storage\\ Handler\\ SessionHandlerProxy `
256
258
will be used to wrap any custom save handlers, that implement :phpclass: `SessionHandlerInterface `.
257
259
258
260
From PHP 5.4 and above, all session handlers implement :phpclass: `SessionHandlerInterface `
259
- including `Native*SessionHandler ` classes which inherit from :phpclass: `SessionHandler `.
261
+ including `` Native*SessionHandler ` ` classes which inherit from :phpclass: `SessionHandler `.
260
262
261
263
The proxy mechanism allows you to get more deeply involved in session save handler
262
264
classes. A proxy for example could be used to encrypt any session transaction
0 commit comments