0

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.

zeid10
  • 511
  • 8
  • 28

1 Answers1

0
$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.

RockyFord
  • 8,529
  • 1
  • 15
  • 21
  • i am still not able to come up with a working code for this. What i need is to check for the inactivity of the user. If the user is inactive log the user out and kill the session. Can someone provide a sample code? the one above is not working. thank you. – zeid10 May 21 '13 at 19:56
  • That requires javascript. PHP and ZF can detect hops and elapsed time. To test for inactivity will require client side code. – RockyFord May 23 '13 at 10:24