开发者

Get Session expiration time in Zend Framework

开发者 https://www.devze.com 2023-02-13 18:54 出处:网络
Is there a way in Zend Framework or PHP to get the time until the Session(PHPSESSID cookie) exp开发者_Python百科ires?I don\'t know of any method provided by the framework to achieve this. But as soon

Is there a way in Zend Framework or PHP to get the time until the Session(PHPSESSID cookie) exp开发者_Python百科ires?


I don't know of any method provided by the framework to achieve this. But as soon as you know where ZF stores expiration time for its namespaces, you might be able to do something like this:

$session = new Zend_Session_Namespace( 'Zend_Auth' );
$session->setExpirationSeconds( 60 );

$timeLeftTillSessionExpires = $_SESSION['__ZF']['Zend_Auth']['ENT'] - time();
0

精彩评论

暂无评论...
验证码 换一张
取 消