Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Authentication 使用Zend2和LDAP登录-一段时间后断开连接_Authentication_Zend Framework2_Ldap - Fatal编程技术网

Authentication 使用Zend2和LDAP登录-一段时间后断开连接

Authentication 使用Zend2和LDAP登录-一段时间后断开连接,authentication,zend-framework2,ldap,Authentication,Zend Framework2,Ldap,我正在将Zend2与LDAP一起使用以验证用户 但当系统闲置一段时间后,它会自动断开连接 以下是一些信息: $ldap = $this->getServiceLocator()->get('Application\Service\Ldap'); $user = $ldap->authenticate($username, $password); $session = $this->getServiceLocator()->get('SessionStorage');

我正在将Zend2与LDAP一起使用以验证用户

但当系统闲置一段时间后,它会自动断开连接

以下是一些信息:

$ldap = $this->getServiceLocator()->get('Application\Service\Ldap');
$user = $ldap->authenticate($username, $password);
$session = $this->getServiceLocator()->get('SessionStorage');

如何增加时间或禁用自动断开连接?

您需要通过SessionManager设置所需的会话到期时间。可以找到这方面的一个示例(该过程不特定于ZfcUser)

如果您想将会话的生存期延长到合理的单次访问时间范围之外(即:>30分钟),您应该使用类似*的方法,因为将单个会话保持太长时间()


*=它是特定于ZfcUser的,因此如果不使用它,您需要实现自己的功能

您的意思是会话过期,用户不再登录吗?看起来不像LDAP问题,而是会话超时。还是每次请求都调用authenticate方法?是@AdamLundrigan,会话过期,用户必须重新登录。@heiglandreas,你说得对,这是会话超时。系统在用户输入的每个页面中验证用户会话。我不知道在哪里可以更改此超时以使其更大。谢谢Adam,我稍后会尝试将结果发布到这里。