I have added our legacy site into a legacy bindle in our new Symfony App.
I have an issue with sessions though.
If I use the default session handler for Symfony I get the following:
session has already been started by session.auto-start or session_start()

However if I use a session php_bridge as suggested for legacy app integration (most likely not for this but for $_SESSION) Then the site loads but the sessions won't persist or if they do they can't be destroyed.

My related question here
Any one have any suggestions?
Kind Regards Nathan
few months ago, I wraped our legacy Zend application in a Symfony project too, using Zf1WrapperBundle. I faced the same "session already started" problem than u do.
To quickly fix that, I edited Zend/library/Zend/Session.php. It's kinda dirty, but it works great. If you want to go this way, you have to do this (depending on your Zend 1 version, lines number may differ) :
line 462: Comment it
// throw new Zend_Session_Exception('session has already been started by session.auto-start or session_start()');line 480: Disable errors trigger
$startedCleanly = @session_start();line 490: Comment it
// session_write_close();line 493: Comment it
// throw new Zend_Session_Exception(__CLASS__ . '::' . ____FUNCTION____ . '() - ' . Zend_Session_Exception::$sessionStartError);line 728: Disable errors trigger
@session_destroy();
That being said, in that case, editing Zend core file is not as bad as it sounds, because if you wrapped your legacy project inside Symfony, you're probably thinking of fully migrating your legacy zend project to symfony. In few months, you'll get rid of legacy zend code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With