public function exists($name, $namespace = 'default')
    {
        if ($this->state !== static::STATE_ACTIVE && $this->state !== static::STATE_EXPIRED) {
            if ($this->debug) {
                throw new \RuntimeException('Session is not active.');
            }

            return false;
        }

        return $this->getBag($namespace)->has($name);
    }
public function exists($name, $namespace = 'default')
    {
        if ($this->state !== static::STATE_ACTIVE && $this->state !== static::STATE_EXPIRED) {
            if ($this->debug) {
                throw new \RuntimeException('Session is not active.');
            }

            return false;
        }

        return $this->getBag($namespace)->has($name);
    }
public function exists ( $ name , $ namespace = 'default' ) { if ( $ this -> state !== static :: STATE_ACTIVE && $ this -> state !== static :: STATE_EXPIRED ) { if ( $ this -> debug ) { throw new \ RuntimeException ( 'Session is not active.' ) ; } return false ; } return $ this -> getBag ( $ namespace ) -> has ( $ name ) ; }
Check whether data exists in the session store

@param   string $name      Name of variable
@param   string $namespace Namespace to use, default to 'default'

@throws  \RuntimeException
@return  boolean  True if the variable exists

@since   2.0
Check whether data exists in the session store