New Server: Zend_Session_Exception “session has already been started” http to https & vice versa

zend-frameworkzend-session

I'm trying to move a website to a new host (MediaTemple.)

When you stick to http, or https everything is fine. When going from http->https or https->http you get the error.

Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start()' 
    in /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Session.php:462 
Stack trace: 
#0 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Session/Namespace.php(143): Zend_Session::start(true) 
#1 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Auth/Storage/Session.php(87): Zend_Session_Namespace->__construct('Zend_Auth') 
#2 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Auth.php(91): Zend_Auth_Storage_Session->__construct() 
#3 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Auth.php(141): Zend_Auth->getStorage() 
#4 /var/www/vhosts/FakeSite.com/httpdocs/application/layouts/layout.phtml(12): Zend_Auth->hasIdentity() 
#5 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/View.php(108): include('/var/www/vhosts...') 
#6 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/View/Abstract.php(831): Zend_View->_run('/var/www/vhosts...') 
#7 /var/www/vh in /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Session.php on line 462 

Session path is writable, and seems to work fine if you stick to one protocol. There are no session_start() calls, and session.auto-start is 0.

Code is running on 3 other servers fine. It must be a configuration issue, but I haven't been able to find it

Best Answer

Sure looks like the server is configured with session.auto_start = 1.

So, maybe add to configs/application.ini:

phpSettings.session.auto_start = 0
Related Topic