Skip to content

Commit 67a5ecd

Browse files
author
Drak
committed
Added nortes as per @stof's recommendation.
1 parent 0437733 commit 67a5ecd

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

components/http_foundation/session_php_legacy.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ Sometimes it may be necessary to integrate Symfony into a legacy application
99
where you do not initially have the level of control you require.
1010

1111
As stated elsewhere, Symfony Sessions are designed to replace the use of
12-
PHP's native `session_*()` functions and use of the `$_SESSION`
12+
PHP's native ``session_*()`` functions and use of the ``$_SESSION``
1313
superglobal. Additionally, it is mandatory for Symfony to start the session.
1414

1515
However when there really are circumstances where this is not possible, it is possible
1616
to use a special storage bridge
1717
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpSessionStorage`
1818
which is designed to allow Symfony to work with a session started outside of
1919
the Symfony Session framework. You are warned that things can interrupt this
20-
use case unless you are careful: for example legacy application erases `$_SESSION`.
20+
use case unless you are careful: for example legacy application erases ``$_SESSION``.
2121

2222
Typical use of this might look as follows::
2323

@@ -37,4 +37,13 @@ Typical use of this might look as follows::
3737
$session->start();
3838

3939
This will allow you to start using the Symfony Session API and allow
40-
migration of your application to Symfony Sessions.
40+
migration of your application to Symfony Sessions.
41+
42+
.. note::
43+
44+
Symfony Sessions store data like attributes in special 'Bags' which use a
45+
key in the ``$_SESSION`` superglobal. This means that a Symfony Session
46+
cannot access arbitary keys in ``$_SESSION`` that may be set by the legacy
47+
application, although all the ``$_SESSION`` contents will be saved when
48+
the session is saved.
49+

0 commit comments

Comments
 (0)