title: Why does my PHP with Zend Framework go crazy about "session started" since update to 5.4 (after a session exists on filesystem)?
body: <p>I never had problems with any of my projects. Just recently when I ran a pacman-update in arch linux (which updated to 5.4) many of my projects where not runnable anymore.</p>
  
  <p>Interestingly the problem only occurs <strong>as soon as the session-file was created on the filesystem</strong>. I mean, I can call the website a first time, as long as the /tmp/sess* does not exist.</p>
  
  <p>When I want to call it a second time and /tmp/sess* has already been written, I get the following error (including stacktrace, Zend Framework).</p>
  
  <pre><code>Zend_Controller_Exception: session has already been started by session.auto-start or session_start()#0 /srv/http/bahasa/library/Zend/Session/Namespace.php(143): Zend_Session::start(true)
  #1 /srv/http/bahasa/library/Zend/Auth/Storage/Session.php(87): Zend_Session_Namespace-&gt;__construct('Zend_Auth')
  #2 /srv/http/bahasa/library/Zend/Auth.php(91): Zend_Auth_Storage_Session-&gt;__construct()
  #3 /srv/http/bahasa/library/Zend/Auth.php(141): Zend_Auth-&gt;getStorage()
  #4 /srv/http/bahasa/library/Skoch/Controller/Plugin/Navigation.php(59): Zend_Auth-&gt;hasIdentity()
  #5 /srv/http/bahasa/library/Zend/Controller/Plugin/Broker.php(287): Skoch_Controller_Plugin_Navigation-&gt;dispatchLoopStartup(Object(Zend_Controller_Request_Http))
  #6 /srv/http/bahasa/library/Zend/Controller/Front.php(928): Zend_Controller_Plugin_Broker-&gt;dispatchLoopStartup(Object(Zend_Controller_Request_Http))
  #7 /srv/http/bahasa/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front-&gt;dispatch()
  #8 /srv/http/bahasa/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap-&gt;run()
  #9 /srv/http/bahasa/public/index.php(30): Zend_Application-&gt;run()
  #10 {main} in /srv/http/bahasa/library/Zend/Controller/Plugin/Broker.php on line 312
  </code></pre>
  
  <p>Of course I already checked other answers for this problem on stackoverflow, but:</p>
  
  <ul>
  <li>session.auto-start is set to 0</li>
  <li>there is no session_start() call at a place outside library/Zend/ (did grep -r on the whole project dir)</li>
  <li>writing Zend_Session::start() in Bootstrap.php (as a bugfix) lead to new fatal errors</li>
  <li>filesystem rights are ok, /tmp has 777 and the created sess-file has http rw (777 does not change the behaviour).</li>
  </ul>
  
  <p>Also as said it strangely happened as soon as I updated from PHP 5.3 to PHP 5.4. The problem is, downgrading does not seem to work (then the mysql-libraries are broken somehow).</p>
  
  <p>And as already mentioned, the most strange thing to me is, that it <strong>only happens when the session-file has been created in /tmp</strong>. When /tmp does not have a session file, it all works perfectly.</p>
  
  <p>And yeah, it’s not only my own project affected, but also that I am working on for another company (which runs like charms on their server and their local PCs), so that also sort of contradicts the problem within my own code (as same thing happens at two Zend Framework projects).</p>
  
  <p>And of course my project also runs like charms on my online webspace with PHP 5.2.12.</p>
  
  <p>I guess the PHP notice before could also be interesting:</p>
  
  <pre><code>Notice: Array to string conversion in /srv/http/bahasa/library/Zend/Session/Exception.php on line 58
  
  Call Stack:
  0.0009     134352   1. {main}() /srv/http/bahasa/public/index.php:0
  0.2805    3703732   2. Zend_Application-&gt;run() /srv/http/bahasa/public/index.php:30
  0.2805    3703756   3. Zend_Application_Bootstrap_Bootstrap-&gt;run() /srv/http/bahasa/library/Zend/Application.php:366
  0.2806    3703876   4. Zend_Controller_Front-&gt;dispatch() /srv/http/bahasa/library/Zend/Application/Bootstrap/Bootstrap.php:97
  0.2873    3829732   5. Zend_Controller_Plugin_Broker-&gt;routeStartup() /srv/http/bahasa/library/Zend/Controller/Front.php:908
  0.2873    3829820   6. Skoch_Controller_Plugin_Autologin-&gt;routeStartup() /srv/http/bahasa/library/Zend/Controller/Plugin/Broker.php:237
  0.2883    3840992   7. Zend_Auth-&gt;hasIdentity() /srv/http/bahasa/library/Skoch/Controller/Plugin/Autologin.php:12
  0.2884    3841016   8. Zend_Auth-&gt;getStorage() /srv/http/bahasa/library/Zend/Auth.php:141
  0.2960    3980864   9. Zend_Auth_Storage_Session-&gt;__construct() /srv/http/bahasa/library/Zend/Auth.php:91
  0.2960    3981072  10. Zend_Session_Namespace-&gt;__construct() /srv/http/bahasa/library/Zend/Auth/Storage/Session.php:87
  0.2961    3981232  11. Zend_Session::start() /srv/http/bahasa/library/Zend/Session/Namespace.php:143
  0.2968    3989956  12. session_start() /srv/http/bahasa/library/Zend/Session.php:469
  0.2972    3997536  13. PropelAutoloader-&gt;autoload() /srv/http/bahasa/library/Zend/Session.php:0
  0.3000    4060508  14. require('/srv/http/bahasa/application/models/bahasa/User.php') /srv/http/bahasa/library/propel-1.6.4/runtime/lib/util/PropelAutoloader.php:108
  0.3377    4925056  15. Zend_Session_Exception::handleSessionStartError() /srv/http/bahasa/library/propel-1.6.4/runtime/lib/util/PropelAutoloader.php:16
  </code></pre>
  
  <p>However, Propel does not seem to have any session_start() within the own code, so that’s not the cause (propel also lies within the checked project director).</p>
  
  <p>I personally do not see the full meaning in this notice yet, but the longer I look at it the more it seems to be related to the error (at least the stack trace, I mean the notice is only about array to string conversion).</p>
  
  <h1>Backtraces for calls to Zend_Session::start()</h1>
  
  <p>Okay, I found the backtraces when <code>Zend_Session::start()</code> gets called twice.</p>
  
  <p>First:</p>
  
  <pre><code>#0  Zend_Session::start(1) called at [/srv/http/bahasa/library/Zend/Session/Namespace.php:143]
  #1  Zend_Session_Namespace-&gt;__construct(Zend_Auth) called at [/srv/http/bahasa/library/Zend/Auth/Storage/Session.php:87]
  #2  Zend_Auth_Storage_Session-&gt;__construct() called at [/srv/http/bahasa/library/Zend/Auth.php:91]
  #3  Zend_Auth-&gt;getStorage() called at [/srv/http/bahasa/library/Zend/Auth.php:141]
  #4  Zend_Auth-&gt;hasIdentity() called at [/srv/http/bahasa/library/Skoch/Controller/Plugin/Autologin.php:12]
  #5  Skoch_Controller_Plugin_Autologin-&gt;routeStartup(Zend_Controller_Request_Http Object ([] =&gt; Array ([0] =&gt; _GET,[1] =&gt; _POST),[] =&gt; /de/,[] =&gt; ,[] =&gt; ,[] =&gt; ,[] =&gt; Array (),[] =&gt; ,[] =&gt; Array (),[] =&gt; ,[] =&gt; ,[] =&gt; module,[] =&gt; ,[] =&gt; controller,[] =&gt; ,[] =&gt; action)) called at [/srv/http/bahasa/library/Zend/Controller/Plugin/Broker.php:237]
  #6  Zend_Controller_Plugin_Broker-&gt;routeStartup(Zend_Controller_Request_Http Object ([] =&gt; Array ([0] =&gt; _GET,[1] =&gt; _POST),[] =&gt; /de/,[] =&gt; ,[] =&gt; ,[] =&gt; ,[] =&gt; Array (),[] =&gt; ,[] =&gt; Array (),[] =&gt; ,[] =&gt; ,[] =&gt; module,[] =&gt; ,[] =&gt; controller,[] =&gt; ,[] =&gt; action)) called at [/srv/http/bahasa/library/Zend/Controller/Front.php:908]
  #7  Zend_Controller_Front-&gt;dispatch() called at [/srv/http/bahasa/library/Zend/Application/Bootstrap/Bootstrap.php:97]
  #8  Zend_Application_Bootstrap_Bootstrap-&gt;run() called at [/srv/http/bahasa/library/Zend/Application.php:366]
  #9  Zend_Application-&gt;run() called at [/srv/http/bahasa/public/index.php:29]
  </code></pre>
  
  <p>Second:</p>
  
  <pre><code>#0  Zend_Session::start(1) called at [/srv/http/bahasa/library/Zend/Session/Namespace.php:143]
  #1  Zend_Session_Namespace-&gt;__construct(Zend_Auth) called at [/srv/http/bahasa/library/Zend/Auth/Storage/Session.php:87]
  #2  Zend_Auth_Storage_Session-&gt;__construct() called at [/srv/http/bahasa/library/Zend/Auth.php:91]
  #3  Zend_Auth-&gt;getStorage() called at [/srv/http/bahasa/library/Zend/Auth.php:141]
  #4  Zend_Auth-&gt;hasIdentity() called at [/srv/http/bahasa/library/Skoch/Controller/Plugin/Navigation.php:59]
  #5  Skoch_Controller_Plugin_Navigation-&gt;dispatchLoopStartup(Zend_Controller_Request_Http Object ([] =&gt; Array ([0] =&gt; _GET,[1] =&gt; _POST),[] =&gt; /de/,[] =&gt; ,[] =&gt; ,[] =&gt; de,[] =&gt; …
  </code></pre>