我正在使用Zend Framework for PHP并使用Zend_Session模块处理会话.这是我在初始化程序(或引导程序)中的内容:
Zend_Session::start();
Zend_Session::rememberMe(864000);
Run Code Online (Sandbox Code Playgroud)
864000秒应该是好的10天,但我仍然被踢出大约一个小时(或者可能少一点).我已经通过设置为10秒来测试这个语句是否有效,并且确实在适当的时候被踢出去了,但是当我将它设置为非常高的值时,它不起作用!我在这里查看了一些文档:http: //framework.zend.com/manual/en/zend.session.html
我看到的另一种方法是使用以下方法:
$authSession = new Zend_Session_Namespace('Zend_Auth');
$authSession->setExpirationSeconds(3600);
Run Code Online (Sandbox Code Playgroud)
现在,我有不同的命名空间.这是否意味着如果我想让它们过期,我必须为所有这些设置它?我还没有测试过这种设置过期的方法,但我真的很想看看这里的大师们对于解决这个问题的正确方法有何看法.非常感谢...
此外,有谁知道我怎么能这样做,以便会话永远不会到期?我已经尝试将第二个设置为0和-1,但是会引发错误.
我在我的应用中使用https://simplesamlphp.org/.大部分时间都很好,没有问题.其他时候我得到这个:
SimpleSAML_Error_Error: UNHANDLEDEXCEPTION
Backtrace:
0 ssoclient/www/module.php:180 (N/A)
Caused by: SimpleSAML_Error_Exception: Received an assertion that is valid in the future. Check clock synchronization on IdP and SP.
Backtrace:
3 ssoclient/modules/saml/lib/Message.php:565 (sspmod_saml_Message::processAssertion)
2 ssoclient/modules/saml/lib/Message.php:523 (sspmod_saml_Message::processResponse)
1 ssoclient/modules/saml/www/sp/saml2-acs.php:75 (require)
0 ssoclient/www/module.php:135 (N/A)
Run Code Online (Sandbox Code Playgroud)
为什么会发生这种情况,我该如何解决?我需要更改系统时间吗?(我在Debian上).