phpmysqlsessionzend-frameworkzend-auth

Zend Framework losing sessions at random moments?


Since a few days, I have a strange problem with Zend sessions. It seems that Zend_Auth::getInstance() seems to be empty at random moments, which causes users to be logged out. Sometimes this happens after a few seconds, sometimes a few minutes and sometimes not for a while. The application has been running without any problems for a year now on 2 different servers, both have this problem since a few days. The cookie information matches the information in the user session db table. Both are still available when a user gets logged out (lifetime 864000 seconds). Cookie expires only 'at end of session'. This also only happens on production servers, not locally.

Anyone know what the problem can be?


Solution

  • I found the problem. There was an image loaded on the login page, which didn't exist. For some reason this image kept loading until the maximum execution time of 30 seconds was exceeded. The error resulted in the session being cleared, even though the user had logged in meanwhile. You can't make this stuff up!