Zend framework session expires prematurely

前端 未结 5 955
既然无缘
既然无缘 2020-12-14 21:28

I\'m using Zend Framework for PHP and handling sessions with the Zend_Session module. This is what I have in my Initializer (or bootstrap):

Zend_Session::st         


        
5条回答
  •  醉梦人生
    2020-12-14 22:09

    Are there other PHP applications running on the server?

    Assuming you're using the standard, file-based, session handler, PHP will store all sessions in the same place (typically /tmp).

    If you have some other script on the server using the default session_gc_maxlifetime settings, it may be eating your session files.

    The easiest fix to try is to configure PHP to store session files for this application someplace special -- that way other apps running on the server will never accidently "clean up" session data from this app.

    Try creating a directory like /tmp/myAppPhpSessions (or whatever), and adding:

    ini_set('session.save_path','/tmp/myAppPhpSessions');
    ini_set('session.gc_maxlifetime', 864000);
    

    at the very top of your bootstrap file.

    Make sure session.auto_start is off in php.ini

提交回复
热议问题