Issues

ZF2-410: Expiration hops in Zend\Session\Container do not remove expired values

Issue Type: Bug Created: 2012-07-19T21:39:55.000+0000 Last Updated: 2012-10-08T20:15:07.000+0000 Status: Closed Fix version(s): Reporter: Jurian Sluiman (mithras) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend\Session

Related issues: Attachments:

Description

If some keys are set to expire after specific hops, the keys do not expire. Sample code, from an action controller:

<pre class="highlight">
use Zend\Session\Container;

public function firstAction()
{
  $container = new Container('issue-test');
  $container->setExpirationHops(1);

  $container->foo = 'bar';
}

public function secondAction()
{
  $container = new Container('issue-test');
  echo $container->foo; // bar
}

public function thirdAction()
{
  $container = new Container('issue-test');
  echo $container->foo; // bar
}

Request first > second > third.

Expected behaviour: secondAction shows bar, thirdAction null Actual behaviour: secondAction shows bar, thirdAction shows bar

At this moment, there is no option to automatically expire keys, you need to manually unset them. For example, see the comment in this PR: https://github.com/bjyoungblood/zf2/…

Comments

Posted by Ralph Schindler (ralph) on 2012-10-08T20:15:07.000+0000

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2505

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts