Why does Symfony2 recommend avoiding the use of "obsolete" php sessions?

I have a web application built with standard PHP. I learn Symfony by creating a sub-application (for site administrators / owners) using Symfony2. So far so good ..
 My symfony application calls the initialization code from the "parent" application, and this initialization code sets some (obsolete) session variables that this child application may or may not use.

But I noticed in the Symfony documentation that they recommend avoiding using obsolete PHP sessions. http://symfony.com/doc/current/components/http_foundation/sessions.html http://symfony.com/doc/current/components/http_foundation/session_php_bridge.html

Why are they making this recommendation?

This is simply because Symfony session management is “better” (and using the obsolete SESSION supergroup is an anti-pattern) --- or is there any other incompatibility or problem that could be caused by the code from my “parent” applications using legacy sessions? Or some other / additional reasons?

+2
source share
1 answer

http://symfony.com/doc/current/components/http_foundation/session_php_bridge.html, :

  • SF2 $_SESSION, "" session. session_start - , .

  • "", . "" , SF. $_SESSION, . , , SF2 .

, print_r(array_keys($_SESSION)); Symfony2:

Array
(
    [0] => _sf2_attributes
    [1] => _sf2_flashes
    [2] => _sf2_meta
)

, , SF - , .

"" , (:) "PHP newbies", .

- ( $_SESSION superglobal PHP) 100% , , .

+5

All Articles