code/table/session.php
public function exists($userid)
	{
		$query = $this->_db->getQuery(true)
			->select('COUNT(userid)')
			->from($this->_db->quoteName($this->_tbl))
			->where($this->_db->quoteName('userid') . ' = ' . $this->_db->quote($userid));
		$this->_db->setQuery($query);

		if (!$result = $this->_db->loadResult())
		{
			$this->setError($this->_db->stderr());

			return false;
		}

		return (boolean) $result;
	}
public function exists($userid)
	{
		$query = $this->_db->getQuery(true)
			->select('COUNT(userid)')
			->from($this->_db->quoteName($this->_tbl))
			->where($this->_db->quoteName('userid') . ' = ' . $this->_db->quote($userid));
		$this->_db->setQuery($query);

		if (!$result = $this->_db->loadResult())
		{
			$this->setError($this->_db->stderr());

			return false;
		}

		return (boolean) $result;
	}
public function exists ( $ userid ) { $ query = $ this -> _db -> getQuery ( true ) -> select ( 'COUNT(userid)' ) -> from ( $ this -> _db -> quoteName ( $ this -> _tbl ) ) -> where ( $ this -> _db -> quoteName ( 'userid' ) . ' = ' . $ this -> _db -> quote ( $ userid ) ) ; $ this -> _db -> setQuery ( $ query ) ; if ( ! $ result = $ this -> _db -> loadResult ( ) ) { $ this -> setError ( $ this -> _db -> stderr ( ) ) ; return false ; } return ( boolean ) $ result ; }
Find out if a user has one or more active sessions

@param   integer  $userid  The identifier of the user

@return  boolean  True if a session for this user exists

@since   11.1
@deprecated  13.3  Use SQL queries to interact with the session table.
Find out if a user has one or more active sessions