Search code examples
zend-frameworksession-timeoutzend-auth

set timeout for session using zend


How do you renew a session everytime a user requests a page?I am using the code below but does not seem to be working.

$zend_authNS = new Zend_Session_Namespace('Zend_Auth');
$zend_authNS->setExpirationSeconds( 3600);

This will expire the no matter what, if the user is clicking on diffrente pages or if it is inactive.

thank you.


Solution

  • $zend_authNS->setExpirationHops(1);
    

    Would be the normal way to expire a session on each page request.

    You seem to be using Zend_Auth, so I wonder if this can be accomplished using the storage component of Zend_Auth, maybe:

    Zend_Auth::getInstance()->getStorage()->getNamespace()->setExpirationHops(1);
    

    Haven't tried it but it might work.