Get Session expiration time in Zend Framework
10,962
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();
Related videos on Youtube
Author by
fsteinbauer
Updated on June 04, 2022Comments
-
fsteinbauer almost 2 years
Is there a way in Zend Framework or PHP to get the time until the Session(PHPSESSID cookie) expires?
-
fsteinbauer about 13 yearsWell i guess it should be
$_SESSION['__ZF']['Zend_Auth']['ENVT'] - time();
But still, thanks for your help!! Wouldn't have made it without your ;)