Skip to content

Commit 94d11ef

Browse files
committed
Revert "Merge pull request #2475 from drak/session_demand"
This reverts commit bd3e58e, reversing changes made to 73e5095. Reverted because the code change was reverted
1 parent c2bb5a0 commit 94d11ef

File tree

2 files changed

+1
-83
lines changed

2 files changed

+1
-83
lines changed

components/http_foundation/session_configuration.rst

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ examples if you wish to write your own.
7979
Example usage::
8080

8181
use Symfony\Component\HttpFoundation\Session\Session;
82-
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
82+
use Symfony\Component\HttpFoundation\Session\Storage\SessionStorage;
8383
use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;
8484

8585
$storage = new NativeSessionStorage(array(), new PdoSessionHandler());
@@ -217,45 +217,6 @@ particular cookie by reading the ``getLifetime()`` method::
217217
The expiry time of the cookie can be determined by adding the created
218218
timestamp and the lifetime.
219219

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-
259220
PHP 5.4 compatibility
260221
~~~~~~~~~~~~~~~~~~~~~
261222

reference/configuration/framework.rst

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ Configuration
2626
* enabled
2727
* field_name
2828
* `session`_
29-
* `name`_
30-
* `mock_name`_
31-
* `auto_start`_
32-
* `on_demand`_
3329
* `cookie_lifetime`_
3430
* `cookie_path`_
3531
* `cookie_domain`_
@@ -156,43 +152,6 @@ csrf_protection
156152
session
157153
~~~~~~~
158154

159-
on_demand
160-
.........
161-
162-
**type**: ``string`` **default**: ``on``
163-
164-
Can be values
165-
166-
- ``on`` - start automatically if not started upon session read/write
167-
- ``off`` - do not start session automatically on data read/write, if an attempt is
168-
make to do so, throw a ``\RuntimeException``
169-
- ``off_lax`` - do not start session automatically on data read/write, but if an attempt
170-
is made to read or write to the session, allow access to the relevent bag.
171-
If data is written to the bags and a session is subsequently started, it will be
172-
overwritten.
173-
174-
auto_start
175-
..........
176-
177-
**type**: ``Boolean`` **default**: ``false``
178-
179-
This controls the ``SessionListener`` which will automatically start the session
180-
during the Request cycle.
181-
182-
name
183-
....
184-
185-
**type**: ``string``
186-
187-
Sets the session cookie name
188-
189-
mock_name
190-
.........
191-
192-
**type**: ``string``
193-
194-
Sets the mock session cookie name
195-
196155
cookie_lifetime
197156
...............
198157

@@ -507,8 +466,6 @@ Full Default Configuration
507466
session:
508467
storage_id: session.storage.native
509468
handler_id: session.handler.native_file
510-
auto_start: false
511-
on_demand: on #on, off or off_lax
512469
name: ~
513470
cookie_lifetime: ~
514471
cookie_path: ~

0 commit comments

Comments
 (0)