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();
Share:
10,962

Related videos on Youtube

fsteinbauer
Author by

fsteinbauer

Updated on June 04, 2022

Comments

  • fsteinbauer
    fsteinbauer almost 2 years

    Is there a way in Zend Framework or PHP to get the time until the Session(PHPSESSID cookie) expires?

  • fsteinbauer
    fsteinbauer about 13 years
    Well i guess it should be $_SESSION['__ZF']['Zend_Auth']['ENVT'] - time(); But still, thanks for your help!! Wouldn't have made it without your ;)

Related