例如一个小时后,是否有办法销毁(Apache)服务器上的会话?现在,该会话将永远保留在Apache文件夹中,因此,每次我启动应用程序时,都会选择旧会话(而且我也不想这么做)。
use Zend\Session\Storage\SessionArrayStorage;
use Zend\Session\Validator\RemoteAddr;
use Zend\Session\Validator\HttpUserAgent;
return [
// Session configuration.
'session_config' => [
// Session cookie will expire in 1 hour.
'cookie_lifetime' => 60*60,
// Store session data on server for 1 hour.
'gc_maxlifetime' => 60*60,
],
// Session manager configuration.
'session_manager' => [
// Session validators (used for security).
'validators' => [
RemoteAddr::class,
HttpUserAgent::class,
]
],
// Session storage configuration.
'session_storage' => [
'type' => SessionArrayStorage::class
],
// ...
];