Esempio n. 1
0
 /**
  * 
  * Checks if an entry has expired (is past its lifetime) or not.
  * 
  * If lifetime is empty (zero), then the entry never expires.
  * 
  * @param string $key The entry key with prefix already added.
  * 
  * @return bool
  * 
  */
 protected function _isExpired($key)
 {
     // is life set as "forever?"
     if (!$this->_life) {
         return false;
     }
     // is it past its expiration date?
     if (time() >= $this->_expires->get($key)) {
         return true;
     }
     // not expired yet
     return false;
 }
Esempio n. 2
0
 /**
  * 
  * Gets the token value to be used in outgoing forms.
  * 
  * @return string
  * 
  */
 public function getToken()
 {
     $this->_update();
     return self::$_session->get('token');
 }
Esempio n. 3
0
 /**
  * 
  * Retrieve the status text from the session and then deletes it, making it
  * act like a read-once session flash value.
  * 
  * @return string The status text.
  * 
  */
 public function getStatusText()
 {
     $val = $this->_session->get('status_text');
     $this->_session->delete('status_text');
     return $val;
 }