public function _ZF_expireAll($args)
 {
     Zend_Session_Core::setOptions(array('remember_me_seconds' => 15, 'gc_probability' => 2));
     session_id($args[0]);
     if (isset($args[1]) && !empty($args[1])) {
         $s = new Zend_Session($args[1]);
     } else {
         $s = new Zend_Session();
     }
     $result = '';
     foreach ($s->getIterator() as $key => $val) {
         $result .= "{$key} === {$val};";
     }
     $core = Zend_Session_Core::getInstance();
     $core->expireSessionCookie();
     $core->writeClose();
     echo $result;
 }
Exemplo n.º 2
0
 public function testSetOptions()
 {
     try {
         Zend_Session_Core::setOptions(array('foo' => 'break me'));
         $this->fail('No exception was returned when trying to set an invalid option');
     } catch (Zend_Session_Exception $e) {
         $this->assertRegexp('/unknown.option/i', $e->getMessage());
     }
 }
Exemplo n.º 3
0
 /**
  * Removes an existing authentication token from the location determined by the session
  * namespace and token member name currently set for this object
  *
  * @return void
  */
 public function logout()
 {
     require_once 'Zend/Session/Core.php';
     if (!Zend_Session_Core::isStarted()) {
         Zend_Session_Core::start();
     }
     Zend_Session_Core::setOptions(array('strict' => true));
     require_once 'Zend/Session.php';
     $session = new Zend_Session($this->_sessionNamespace, Zend_Session::SINGLE_INSTANCE);
     if (!isset($session->{$this->_sessionTokenName})) {
         unset($session->{$this->_sessionTokenName});
     }
 }