【发布时间】:2017-12-01 17:32:54
【问题描述】:
我在使用 Zend Framework 3 时遇到了与会话超时相关的问题。会话在 5-10 分钟内过期。我使用了会话的默认代码,Zf3 框架在 global.php 中提供了如下代码。
// Session configuration.
'session_config' => [
'cookie_lifetime' => 60*60*1, // Session cookie will expire in 1 hour.
'gc_maxlifetime' => 60*60*1, // Store session data on server maximum for 1 hour.
],
// Session manager configuration.
'session_manager' =>
[
'validators' => [
RemoteAddr::class,
HttpUserAgent::class,
]
],
// Session storage configuration.
'session_storage' => [
'type' => SessionArrayStorage::class
],
使用上述代码后,会话仍然在 5-10 分钟内过期。我希望会话过期时间超过 30 分钟。如何在 Zf3 中进行配置。
请提供解决方案。
【问题讨论】:
标签: php zend-framework2 zend-framework3