/**
* Check whether data exists in the session store
*
* @param string $name Name of variable
*
* @return boolean True if the variable exists
*
* @since 1.5
*/
public function has($name)
{
// Handle B/C by checking if a namespace was passed to the method, will be removed at 5.0
if (\func_num_args() > 1) {
$args = \func_get_args();
if (!empty($args[1])) {
@trigger_error('Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. ' . 'The namespace should be prepended to the name instead.', E_USER_DEPRECATED);
$name = $args[1] . '.' . $name;
}
}
if (parent::has($name)) {
return true;
}
/*
* B/C for retrieving sessions that originated in Joomla 3.
* A namespace before Joomla 4 has a prefix of 2 underscores (__).
* This is no longer the case in Joomla 4 and will be converted
* when saving new values in `self::set()`
*/
if (strpos($name, '.') !== false && parent::has('__' . $name)) {
return true;
}
// More b/c for retrieving sessions that originated in Joomla 3. This will be removed in Joomla 5
// as no sessions should have this format anymore!
return parent::has('__default.' . $name);
}