ZF3 logout after some inactive session

512 Views Asked by At

How to auto logout session after some inactive? I want this functionality in zend framework 3.If anyone have idea then let me inform please.Currently my application logout within 5 minutes with the used of zend skeleton.But I want session expiration time atleast 30 minutes.

Please provide solution for above.

1

There are 1 best solutions below

1
Dolly Aswin On

Just add this session configuration in your module.config.php, and make sure Zend\Session has been added in config/modules.config.php

use Zend\Session\Storage\SessionArrayStorage;

return [
    // your existing config 

    'session_config' => [
        'cookie_lifetime' => 60 * 30
    ],
    'session_storage' => [
        'type' => SessionArrayStorage::class
    ],
];