» Why does Symfony2 recommend avoiding use of legacy php sessions?
Why does Symfony2 recommend avoiding use of legacy php sessions?
|September 13, 2014
Posted by forumadmin
I have a web application built with standard PHP. I’m learning Symfony by building a sub-application (for administrators/owners of the site) using Symfony2. So far so good..
My symfony app does call some initialization code from the ‘parent’ application, and that initialization code sets some (legacy) session variables that this child application may or may not want to use.
But I’ve noticed in the Symfony documentation that they recommend avoiding use of legacy PHP sessions.
Why do they make this recommendation?
Is it simply because the Symfony session management is “better”, (and use of the legacy SESSION superglobal is somewhat of an anti-pattern) — or, is there any other specific incompatibility or problem that may be caused due to the fact that code from my ‘parent’ application is using legacy sessions? Or some other / additional reasons?
More Related Questions
- Symfony2 login not working I'm developing a website using Symfony2, and until today - had no problem logging in. But now when logging in I'm not correctly authenticated - Symfony profiler lists me as logged in as: […]
- How to enable session in Symfony2? How can I enable session in Symfony2? I would like to use Facebook Login, but I get error message: Session not active, could not store state. (500 Internal Server Error - […]
- SF2 Flash Messages not showing from FlashBag I am attempting to output a flash message to the screen using the FlashBagInterface, however I am having no luck in doing so.
This is my current setup, as you can see my controller sets […]
- What are the Differences between Dev and Prod for Session management? What should I check to solve this problem?
Everything works fine in development, but putting my code on
my web site provider (in production) gives me this error:
RuntimeException: Failed […]
- Unexpected logout in Symfony 2.5 after interactive login After upgrade from 2.4.6 to 2.5 users get logged out every hour or two, though ttl is not that small. Switching back fixes the problem.
- Programmatically logout current user I am trying to programmatically logout the current user from inside a listener.
I read here that […]
- PHP Sessions not working in FireFox I am defining a session variable based on $_POST (from page 1) on page 2 off my application like this:
// Session Name//
$account_manager_id = […]
- TideSDK Desktop: How to create a login system with PHP session? I want to create a login system in my desktop application using TideSDK.
I have tried to use PHP session, but when I run the application and click some link to another page, the session I […]
- PHP session side-effect warning with global variables as a source of data I'm trying to host a PHP web site that was given to me. I see this warning:
Warning: Unknown: Your script possibly
relies on a session side-effect which
existed until PHP 4.2.3. […]
- PHP Sessions across sub domains I am trying to set up the following:
where if the user visits sub1.domain.com or sub2.domain.com and they are not logged in, they get […]