public function check($name = null)
    {
        if ($this->_hasSession() && !$this->started()) {
            $this->start();
        }

        if (!isset($_SESSION)) {
            return false;
        }

        return Hash::get($_SESSION, $name) !== null;
    }
public function check($name = null)
    {
        if ($this->_hasSession() && !$this->started()) {
            $this->start();
        }

        if (!isset($_SESSION)) {
            return false;
        }

        return Hash::get($_SESSION, $name) !== null;
    }
public function check ( $ name = null ) { if ( $ this -> _hasSession ( ) && ! $ this -> started ( ) ) { $ this -> start ( ) ; } if ( ! isset ( $ _SESSION ) ) { return false ; } return Hash :: get ( $ _SESSION , $ name ) !== null ; }
Returns true if given variable name is set in session.

@param string|null $name Variable name to check for
@return bool True if variable is there
Returns true if given variable name is set in session .