API16:JSession/has
From Joomla! Documentation
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Contents |
Description
Check wheter data exists in the session store
Syntax
has($name, $namespace= 'default')
| Parameter Name | Default Value | Description |
|---|---|---|
| $name | Name of variable | |
| $namespace | 'default' | Namespace to use, default to 'default' |
Returns
boolean True if the variable exists
Defined in
libraries/joomla/session/session.php
Importing
jimport( 'joomla.session.session' );
Source Body
public function has($name, $namespace = 'default') { $namespace = '__'.$namespace; //add prefix to namespace to avoid collisions if ($this->_state !== 'active') { // @TODO :: generated error here return null; } return isset($_SESSION[$namespace][$name]); }
[Edit See Also] SeeAlso:JSession/has
Examples
<CodeExamplesForm />
