Skip to main content
added 297 characters in body
Source Link
michael
  • 2.8k
  • 2
  • 12
  • 13

The simplest solution is to set second parameter in the session with value = time() and then to check with it.

require_once 'app/Mage.php';
Mage::app();

$session = Mage::getSingleton('core/session');
$session->setParam1('some');
$session->setParam2(time());

//in other file or I don't know what is your idea
if ($session->hasParam1($param2) && $session->hasParam2() && $session->getParam2() + 300) > time()) {
    //do something with parameterecho 1$session->getParam1();
}

The simplest solution is to set second parameter in the session with value = time() and then to check with

if (($param2 + 300) > time()) {
    //do something with parameter 1
}

The simplest solution is to set second parameter in the session with value = time() and then to check with it.

require_once 'app/Mage.php';
Mage::app();

$session = Mage::getSingleton('core/session');
$session->setParam1('some');
$session->setParam2(time());

//in other file or I don't know what is your idea
if ($session->hasParam1() && $session->hasParam2() && $session->getParam2() + 300 > time()) {
    echo $session->getParam1();
}
Source Link
michael
  • 2.8k
  • 2
  • 12
  • 13

The simplest solution is to set second parameter in the session with value = time() and then to check with

if (($param2 + 300) > time()) {
    //do something with parameter 1
}