@@ -79,7 +79,7 @@ examples if you wish to write your own.
79
79
Example usage::
80
80
81
81
use Symfony\Component\HttpFoundation\Session\Session;
82
- use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage ;
82
+ use Symfony\Component\HttpFoundation\Session\Storage\SessionStorage ;
83
83
use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;
84
84
85
85
$storage = new NativeSessionStorage(array(), new PdoSessionHandler());
@@ -217,45 +217,6 @@ particular cookie by reading the ``getLifetime()`` method::
217
217
The expiry time of the cookie can be determined by adding the created
218
218
timestamp and the lifetime.
219
219
220
- Session start-on-demand
221
- ~~~~~~~~~~~~~~~~~~~~~~~
222
-
223
- .. versionadded :: 2.3
224
- Control over session "start-on-demand" was added in Symfony 2.3.
225
-
226
- In versions 2.1-2.2, Symfony Sessions automatically invoked ``$session->start() `` when
227
- any attempt was made to access session data (effectively 'start on demand').
228
- From Symfony 2.3 this behaviour can be controlled.
229
-
230
- There are three modes defined by
231
- :class: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Storage\\ SessionStorageInterface `
232
-
233
- The settings are as follows:
234
-
235
- - ``SessionStorageInterface::NO_START_ON_DEMAND_STRICT `` - The session will not be started on demand
236
- and any attempt to read or write session data will result in a ``\RuntimeException ``
237
- - ``SessionStorageInterface::START_ON_DEMAND `` - The session will be started if it hasn't already been
238
- when any attempt is made to read or write session data. This setting reflects the default behaviour
239
- since Symfony 2.1
240
- - ``SessionStorageInterface::NO_START_ON_DEMAND_LAX `` - The sessions will not be started on demand
241
- when session data is read or written to. It will allow access to the unitialized ``BagInterface ``.
242
- If this session is subsequently started manually after data is written to a ``BagInterface `` will
243
- be overwritten (by the session data read from persistence).
244
-
245
- You can configure these by injecting a configured storage engine into the session::
246
-
247
- <?php
248
- use Symfony\Component\HttpFoundation\Session\Session;
249
- use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
250
- use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface;
251
- use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;
252
-
253
- $storage = new NativeSessionStorage(array(),
254
- new PdoSessionHandler(),
255
- SessionStorageInterface::NO_START_ON_DEMAND_STRICT);
256
- $session = new Session($storage);
257
-
258
-
259
220
PHP 5.4 compatibility
260
221
~~~~~~~~~~~~~~~~~~~~~
261
222
0 commit comments