/** * * Gets cache entry data. * * @param string $key The entry ID. * * @return mixed Boolean false on failure, cache data on success. * */ public function fetch($key) { if (!$this->_active) { return; } // modify the key to add the prefix $key = $this->entry($key); // does it exist? if (!$this->_entries->has($key)) { return false; } // has it expired? if ($this->_isExpired($key)) { // clear the entry $this->_entries->delete($key); $this->_expires->delete($key); return false; } // return the value return $this->_entries->get($key); }
/** * * Is there a token value in the session already? * * @return string * */ public function hasToken() { $this->_update(); return self::$_session->has('token'); }