Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7f288dc

Browse filesBrowse files
committed
[#2475] Tweaks to new session on-demand docs
1 parent bd3e58e commit 7f288dc
Copy full SHA for 7f288dc

File tree

Expand file treeCollapse file tree

1 file changed

+13
-13
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-13
lines changed

‎components/http_foundation/session_configuration.rst

Copy file name to clipboardExpand all lines: components/http_foundation/session_configuration.rst
+13-13Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -221,30 +221,31 @@ Session start-on-demand
221221
~~~~~~~~~~~~~~~~~~~~~~~
222222

223223
.. versionadded:: 2.3
224-
Control over session "start-on-demand" was added in Symfony 2.3.
224+
Control over session "start-on-demand" was added in Symfony 2.3.
225225

226226
In versions 2.1-2.2, Symfony Sessions automatically invoked ``$session->start()`` when
227227
any attempt was made to access session data (effectively 'start on demand').
228-
From Symfony 2.3 this behaviour can be controlled.
228+
From Symfony 2.3 this behavior can be controlled.
229229

230230
There are three modes defined by
231231
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\SessionStorageInterface`
232232

233233
The settings are as follows:
234234

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).
235+
- ``SessionStorageInterface::NO_START_ON_DEMAND_STRICT`` - The session will
236+
not be started on demand and any attempt to read or write session data will
237+
result in a ``\RuntimeException``;
238+
- ``SessionStorageInterface::START_ON_DEMAND`` - The session will be started
239+
if it hasn't already been when any attempt is made to read or write session
240+
data. This setting reflects the default behavior since Symfony 2.1;
241+
- ``SessionStorageInterface::NO_START_ON_DEMAND_LAX`` - The sessions will
242+
not be started on demand when session data is read or written to. It will
243+
allow access to the uninitialized ``BagInterface``. If the session is subsequently
244+
started manually after data is written to a ``BagInterface``, it will be overwritten
245+
(by the session data read from persistence).
244246

245247
You can configure these by injecting a configured storage engine into the session::
246248

247-
<?php
248249
use Symfony\Component\HttpFoundation\Session\Session;
249250
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
250251
use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface;
@@ -255,7 +256,6 @@ You can configure these by injecting a configured storage engine into the sessio
255256
SessionStorageInterface::NO_START_ON_DEMAND_STRICT);
256257
$session = new Session($storage);
257258

258-
259259
PHP 5.4 compatibility
260260
~~~~~~~~~~~~~~~~~~~~~
261261

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.