Example #1
0
 /**
  * Parses the key turning it into a string (or array is required) suitable to be passed to the cache store.
  *
  * This function is called for every operation that uses keys. For this reason we use this function to also check
  * that the current user is the same as the user who last used this cache.
  *
  * On top of that if prepends the string 'sess_' to the start of all keys. The _ ensures things are easily identifiable.
  *
  * @param string|int $key As passed to get|set|delete etc.
  * @return string|array String unless the store supports multi-identifiers in which case an array if returned.
  */
 protected function parse_key($key)
 {
     $prefix = $this->get_key_prefix();
     if ($key === self::LASTACCESS) {
         return $key . $prefix;
     }
     return $prefix . '_' . parent::parse_key($key);
 }
Example #2
0
 /**
  * Parses the key turning it into a string (or array is required) suitable to be passed to the cache store.
  *
  * This function is called for every operation that uses keys. For this reason we use this function to also check
  * that the current user is the same as the user who last used this cache.
  *
  * On top of that if prepends the string 'sess_' to the start of all keys. The _ ensures things are easily identifiable.
  *
  * @param string|int $key As passed to get|set|delete etc.
  * @return string|array String unless the store supports multi-identifiers in which case an array if returned.
  */
 protected function parse_key($key)
 {
     if ($key === 'lastaccess') {
         $key = '__lastaccess__';
     }
     return 'sess_' . parent::parse_key($key);
 }